Skip to content

Commit

Permalink
check if necessary on ccu.unsubscribe
Browse files Browse the repository at this point in the history
  • Loading branch information
hobbyquaker committed Feb 17, 2019
1 parent 962fdbe commit 58ac4eb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions nodes/redmatic-homekit-homematic-garage.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,12 @@ module.exports = function (RED) {
service.getCharacteristic(hap.Characteristic.CurrentDoorState).removeListener('get', getCurrentDoorStateListener);
service.getCharacteristic(hap.Characteristic.TargetDoorState).removeListener('get', getTargetDoorStateListener);
service.getCharacteristic(hap.Characteristic.TargetDoorState).removeListener('set', setTargetDoorStateListener);
this.ccu.unsubscribe(this.idSubSensorClosed);
this.ccu.unsubscribe(this.idSubSensorOpened);
if (this.idSubSensorClosed) {
this.ccu.unsubscribe(this.idSubSensorClosed);
}
if (this.idSubSensorOpened) {
this.ccu.unsubscribe(this.idSubSensorOpened);
}
});
}
}
Expand Down

0 comments on commit 58ac4eb

Please sign in to comment.