Handle sensor event format correctly
This commit is contained in:
parent
23d106969f
commit
be79d15faf
1 changed files with 3 additions and 1 deletions
|
@ -52,7 +52,9 @@ Vue.component('sensors', {
|
|||
|
||||
onSensorEvent: function(event) {
|
||||
const data = event.data;
|
||||
this.metrics[data.name] = data.value;
|
||||
for (const [name, value] of Object.entries(data)) {
|
||||
this.metrics[name] = value;
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue