diff --git a/src/AutomationSwitchAccessory.js b/src/AutomationSwitchAccessory.js index 28b47af..b9896f4 100644 --- a/src/AutomationSwitchAccessory.js +++ b/src/AutomationSwitchAccessory.js @@ -191,7 +191,10 @@ class SwitchAccessory { nextPeriod() { this.signalMotion(false); - if (!this._state.autoOff) { + if (this._state.autoOff) { + this._state.state = false; + } + if (!this._state.autoOff && this._state.state === true) { this._startTimer(); } } @@ -209,4 +212,4 @@ class SwitchAccessory { } } -module.exports = SwitchAccessory; \ No newline at end of file +module.exports = SwitchAccessory;