From be79d15faf6db56b166d16a6f1cda0524892ee85 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Tue, 2 Jul 2019 15:01:40 +0200 Subject: [PATCH] Handle sensor event format correctly --- platypush/backend/http/static/js/plugins/sensors/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platypush/backend/http/static/js/plugins/sensors/index.js b/platypush/backend/http/static/js/plugins/sensors/index.js index 341b4deb5..d5bfbf7c5 100644 --- a/platypush/backend/http/static/js/plugins/sensors/index.js +++ b/platypush/backend/http/static/js/plugins/sensors/index.js @@ -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; + } }, },