Skip to content

Commit

Permalink
Merge pull request #138 from DouweM/force-bypass
Browse files Browse the repository at this point in the history
Support forceBypass under armingModes
  • Loading branch information
chase9 authored Dec 14, 2024
2 parents e9c3967 + d01f9fb commit a7773f0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,20 @@ This is a plugin for Homebridge, allowing communication with Alarm.com endpoints
"away": {
"noEntryDelay": false,
"silentArming": false,
"nightArming": false
"nightArming": false,
"forceBypass": false
},
"night": {
"noEntryDelay": false,
"silentArming": false,
"nightArming": false
"nightArming": false,
"forceBypass": false
},
"stay": {
"noEntryDelay": false,
"silentArming": false,
"nightArming": false
"nightArming": false,
"forceBypass": false
}
},
"platform": "Alarmdotcom"
Expand Down
3 changes: 2 additions & 1 deletion config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"properties": {
"noEntryDelay": {"type": "boolean", "default": false},
"silentArming": {"type": "boolean", "default": false},
"nightArming": {"type": "boolean", "default": false}
"nightArming": {"type": "boolean", "default": false},
"forceBypass": {"type": "boolean", "default": false}
}
}
},
Expand Down
13 changes: 10 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,17 +142,20 @@ class ADCPlatform implements DynamicPlatformPlugin {
away: {
nightArming: false,
noEntryDelay: false,
silentArming: false
silentArming: false,
forceBypass: false
},
night: {
nightArming: true,
noEntryDelay: false,
silentArming: true
silentArming: true,
forceBypass: false
},
stay: {
nightArming: false,
noEntryDelay: false,
silentArming: true
silentArming: true,
forceBypass: false
}
};

Expand All @@ -162,6 +165,7 @@ class ADCPlatform implements DynamicPlatformPlugin {
this.armingModes[key].nightArming = Boolean(this.config.armingModes[key].nightArming);
this.armingModes[key].noEntryDelay = Boolean(this.config.armingModes[key].noEntryDelay);
this.armingModes[key].silentArming = Boolean(this.config.armingModes[key].silentArming);
this.armingModes[key].forceBypass = Boolean(this.config.armingModes[key].forceBypass);
}
}

Expand Down Expand Up @@ -677,18 +681,21 @@ class ADCPlatform implements DynamicPlatformPlugin {
opts.noEntryDelay = this.armingModes.stay.noEntryDelay;
opts.silentArming = this.armingModes.stay.silentArming;
opts.nightArming = this.armingModes.stay.nightArming;
opts.forceBypass = this.armingModes.stay.forceBypass;
break;
case hapCharacteristic.SecuritySystemTargetState.NIGHT_ARM:
method = armStay;
opts.noEntryDelay = this.armingModes.night.noEntryDelay;
opts.silentArming = this.armingModes.night.silentArming;
opts.nightArming = this.armingModes.night.nightArming;
opts.forceBypass = this.armingModes.night.forceBypass;
break;
case hapCharacteristic.SecuritySystemTargetState.AWAY_ARM:
method = armAway;
opts.noEntryDelay = this.armingModes.away.noEntryDelay;
opts.silentArming = this.armingModes.away.silentArming;
opts.nightArming = this.armingModes.away.nightArming;
opts.forceBypass = this.armingModes.away.forceBypass;
break;
case hapCharacteristic.SecuritySystemTargetState.DISARM:
method = disarm;
Expand Down

0 comments on commit a7773f0

Please sign in to comment.