Handle sensor event format correctly

This commit is contained in:
Fabio Manganiello 2019-07-02 15:01:40 +02:00
parent 23d106969f
commit be79d15faf

View file

@ -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;
}
},
},