Skip to content

Commit

Permalink
Prevent garage-door-opener from being closed automatically if autoClo…
Browse files Browse the repository at this point in the history
…seDelay doesn’t exist
  • Loading branch information
lprhodes committed Jun 19, 2017
1 parent 7ea58c3 commit 2ed4755
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions accessories/garageDoorOpener.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ class GarageDoorOpenerAccessory extends BroadlinkRMAccessory {

this.garageDoorOpenerService.setCharacteristic(Characteristic.CurrentDoorState, 0);

this.autoCloseTimeout = setTimeout(() => {
this.garageDoorOpenerService.setCharacteristic(Characteristic.TargetDoorState, 1);
}, autoCloseDelay * 1000);
if (autoCloseDelay) {
this.autoCloseTimeout = setTimeout(() => {
this.garageDoorOpenerService.setCharacteristic(Characteristic.TargetDoorState, 1);
}, autoCloseDelay * 1000);
}
}, openCloseDuration * 1000);
} else {
if (this.garageDoorOpenerService) clearTimeout(this.garageDoorOpenerService);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "homebridge-broadlink-rm",
"version": "2.5.9",
"version": "2.5.10",
"description": "Broadlink RM plugin (including the mini and pro) for homebridge: https://github.com/nfarina/homebridge",
"license": "ISC",
"keywords": [
Expand Down

0 comments on commit 2ed4755

Please sign in to comment.