Skip to content

Commit

Permalink
Fixed illegal value warning
Browse files Browse the repository at this point in the history
  • Loading branch information
smhex committed Sep 2, 2022
1 parent cc61bbe commit 4d86167
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/devices/HmIPSwitch.ts
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class HmIPSwitch extends HmIPGenericDevice implements Updateable {
const switchChannel = <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);
Expand Down
2 changes: 1 addition & 1 deletion src/devices/HmIPSwitchMeasuring.ts
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class HmIPSwitchMeasuring extends HmIPGenericDevice implements Updateable
const switchMeasuringChannel = <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);
Expand Down
2 changes: 1 addition & 1 deletion src/devices/HmIPSwitchNotificationLight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ export class HmIPSwitchNotificationLight extends HmIPGenericDevice implements Up
const switchChannel = <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);
Expand Down

0 comments on commit 4d86167

Please sign in to comment.