Skip to content

Commit

Permalink
Logic improvements
Browse files Browse the repository at this point in the history
- Fixed Arm Stay when devices are open.
  • Loading branch information
mrjackyliang committed Oct 28, 2019
1 parent 6620968 commit 8982c8a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions adt-pulse.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,13 +461,13 @@ pulse.prototype.setDeviceStatus = function (armState, arm) {
let onClick = $("#arm_button_1").attr("onclick");
let satCode = (onClick !== undefined) ? onClick.split("sat=")[1].split("&")[0] : undefined;

// Check if system requires force arming.
if (arm === "away" && onClick !== undefined && satCode !== undefined) {
let forceUrlBase = "https://portal.adtpulse.com/myhome/quickcontrol/serv/RunRRACommand";
let forceUrlArgs = `?sat=${satCode}&href=rest/adt/ui/client/security/setForceArm&armstate=forcearm&arm=away`;
let forceUrl = forceUrlBase + forceUrlArgs;
let forceUrlBase = "https://portal.adtpulse.com/myhome/quickcontrol/serv/RunRRACommand";
let forceUrlArgs = `?sat=${satCode}&href=rest/adt/ui/client/security/setForceArm&armstate=forcearm&arm=${arm}`;
let forceUrl = forceUrlBase + forceUrlArgs;

that.consoleLogger("ADT Pulse: Some sensors are open or reporting motion. Forcing Arm Away...", "warn");
// Check if system requires force arming.
if (arm === "away" || arm === "stay" && onClick !== undefined && satCode !== undefined) {
that.consoleLogger("ADT Pulse: Some sensors are open or reporting motion. Forcing Arm...", "warn");

request.get(
forceUrl,
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-adt-pulse",
"version": "1.2.5",
"version": "1.2.6",
"description": "Homebridge security system platform for ADT Pulse",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 8982c8a

Please sign in to comment.