diff --git a/src/devices/HmIPSwitch.ts b/src/devices/HmIPSwitch.ts old mode 100644 new mode 100755 index 18fd07d..99900b8 --- a/src/devices/HmIPSwitch.ts +++ b/src/devices/HmIPSwitch.ts @@ -77,7 +77,7 @@ export class HmIPSwitch extends HmIPGenericDevice implements Updateable { const switchChannel = channel; this.platform.log.debug(`Switch update: ${JSON.stringify(channel)}`); - if (switchChannel.on !== this.on) { + if (switchChannel.on !== null && switchChannel.on !== this.on) { this.on = switchChannel.on; this.platform.log.info('Switch state of %s changed to %s', this.accessory.displayName, this.on ? 'ON' : 'OFF'); this.service.updateCharacteristic(this.platform.Characteristic.On, this.on); diff --git a/src/devices/HmIPSwitchMeasuring.ts b/src/devices/HmIPSwitchMeasuring.ts old mode 100644 new mode 100755 index 8418af3..8bcf214 --- a/src/devices/HmIPSwitchMeasuring.ts +++ b/src/devices/HmIPSwitchMeasuring.ts @@ -90,7 +90,7 @@ export class HmIPSwitchMeasuring extends HmIPGenericDevice implements Updateable const switchMeasuringChannel = channel; this.platform.log.debug('Switch (measuring) update: %s', JSON.stringify(channel)); - if (switchMeasuringChannel.on !== this.on) { + if (switchMeasuringChannel.on != null && switchMeasuringChannel.on !== this.on) { this.on = switchMeasuringChannel.on; this.platform.log.info('Switch state of %s changed to %s', this.accessory.displayName, this.on ? 'ON' : 'OFF'); this.service.updateCharacteristic(this.platform.Characteristic.On, this.on); diff --git a/src/devices/HmIPSwitchNotificationLight.ts b/src/devices/HmIPSwitchNotificationLight.ts index fbc3058..e44a3ac 100755 --- a/src/devices/HmIPSwitchNotificationLight.ts +++ b/src/devices/HmIPSwitchNotificationLight.ts @@ -363,7 +363,7 @@ export class HmIPSwitchNotificationLight extends HmIPGenericDevice implements Up const switchChannel = channel; this.platform.log.debug(`Switch update: ${JSON.stringify(channel)}`); - if (switchChannel.on !== this.on) { + if (switchChannel.on !== null && switchChannel.on !== this.on) { this.on = switchChannel.on; this.platform.log.info('Switch state of %s changed to %s', this.accessory.displayName, this.on ? 'ON' : 'OFF'); this.service.updateCharacteristic(this.platform.Characteristic.On, this.on);