s/sensors/data/g

This commit is contained in:
Fabio Manganiello 2018-06-12 00:23:41 +02:00
parent f137595ba0
commit c410bd8926
2 changed files with 2 additions and 2 deletions

View file

@ -4,7 +4,7 @@ $(document).ready(function() {
var onEvent = function(event) { var onEvent = function(event) {
switch (event.args.type) { switch (event.args.type) {
case 'platypush.message.event.sensor.SensorDataChangeEvent': case 'platypush.message.event.sensor.SensorDataChangeEvent':
var data = event.args.sensors; var data = event.args.data;
for (var sensor of Object.keys(data)) { for (var sensor of Object.keys(data)) {
var $sensor = $container.find('[data-sensor-type=' + sensor + ']'); var $sensor = $container.find('[data-sensor-type=' + sensor + ']');

View file

@ -36,7 +36,7 @@ class SensorMcp3008Backend(Backend):
new_measurement[key] = measurement[key] new_measurement[key] = measurement[key]
if new_measurement: if new_measurement:
self.bus.post(SensorDataChangeEvent(sensors=new_measurement)) self.bus.post(SensorDataChangeEvent(data=new_measurement))
self.last_measurement = measurement self.last_measurement = measurement
time.sleep(self.poll_seconds) time.sleep(self.poll_seconds)