Fixed the way the FE widget parses the sensor changes after the structural change to SensorDataChangeEvent

This commit is contained in:
Fabio Manganiello 2018-06-12 20:30:19 +02:00
parent e216eb4792
commit 64ee7e3e59

View file

@ -11,12 +11,12 @@ $(document).ready(function() {
if (event.args.type == 'platypush.message.event.weather.NewWeatherConditionEvent') { if (event.args.type == 'platypush.message.event.weather.NewWeatherConditionEvent') {
updateTemperature(event.args.temperature); updateTemperature(event.args.temperature);
} else if (event.args.type == 'platypush.message.event.sensor.SensorDataChangeEvent') { } else if (event.args.type == 'platypush.message.event.sensor.SensorDataChangeEvent') {
if ('temperature' in event.args) { if ('temperature' in event.args.data) {
updateSensorTemperature(event.args.temperature); updateSensorTemperature(event.args.data.temperature);
} }
if ('humidity' in event.args) { if ('humidity' in event.args) {
updateSensorHumidity(event.args.humidity); updateSensorHumidity(event.args.data.humidity);
} }
} }
}; };