diff --git a/index.js b/index.js index 1d952a2..1520e76 100644 --- a/index.js +++ b/index.js @@ -924,8 +924,8 @@ ADTPulsePlatform.prototype.setDeviceStatus = function (accessory, arm) { .login() .then(async () => { // Attempt to clear the alarms first. - if (lastState.includes("alarm")) { - if (["carbon monoxide", "fire", "burglary"].includes(lastState)) { + if (latestState.includes("alarm")) { + if (["carbon monoxide", "fire", "burglary"].includes(latestState)) { this.logMessage(`Alarm is active! Disarming the ${name} (${id})...`, 20); await this.pulse.setDeviceStatus(oldArmState, "off") diff --git a/package.json b/package.json index eb33b1b..1101744 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "homebridge-adt-pulse", - "version": "1.6.5", + "version": "1.6.6", "description": "Homebridge security system platform for ADT Pulse", "main": "index.js", "scripts": {