Skip to content

Commit

Permalink
Fix disarmed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
MiguelRipoll23 committed Mar 1, 2019
1 parent ff15740 commit 6499fc3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,13 @@ SecuritySystem.prototype.getSwitchState = function(callback) {
SecuritySystem.prototype.setSwitchState = function(state, callback) {
this.on = state;

// Ignore if security system's
// mode is off
if (this.currentState === Characteristic.SecuritySystemCurrentState.DISARMED) {
callback(null);
return;
}

if (state) {
// On
if (this.currentState === Characteristic.SecuritySystemCurrentState.ALARM_TRIGGERED) {
Expand Down

0 comments on commit 6499fc3

Please sign in to comment.