Skip to content

Commit 0cb52b2

Browse files
committed
Bug fixes and button documentation
### UPDATED - Separated logic for getting orb security buttons to its own method (`getOrbSecurityButtons`). - Combined clean and dirty states for when checking if user is arming to the current state and alarm is not active. - Changed wording for debug logs regarding stale login sessions (remove "now"). - Enhanced parsing of gateway and security panel manufacturer/model information. ### FIXED - Comment typo for "sessions.axiosSyncCheck". - Consistent alarm triggered when panel status is showing "Sensor Problem". ### ADDED - Orb security button collections for "Arming Away", "Arming Stay" and "Disarm, Arm Away, Arm Stay".
1 parent f327a39 commit 0cb52b2

File tree

13 files changed

+549
-489
lines changed

13 files changed

+549
-489
lines changed

config.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@
272272
},
273273
{
274274
"value": "ignoreSensorProblemStatus",
275-
"name": "Ignore Sensor Problem Status"
275+
"name": "Ignore \"Sensor Problem\" Panel Status"
276276
}
277277
]
278278
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "homebridge-adt-pulse",
33
"displayName": "Homebridge ADT Pulse",
4-
"version": "3.1.9",
4+
"version": "3.2.0",
55
"description": "Homebridge security system platform for ADT Pulse",
66
"main": "./build/index.js",
77
"exports": "./build/index.js",

src/lib/accessory.ts

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ export class ADTPulseAccessory {
172172
// Set the "AccessoryInformation" characteristics.
173173
this.#services.Information
174174
.setCharacteristic(this.#characteristic.Identify, false)
175-
.setCharacteristic(this.#characteristic.Manufacturer, manufacturer ?? 'ADT')
175+
.setCharacteristic(this.#characteristic.Manufacturer, manufacturer ?? 'N/A')
176176
.setCharacteristic(this.#characteristic.Model, model ?? 'N/A')
177177
.setCharacteristic(this.#characteristic.Name, name)
178178
.setCharacteristic(this.#characteristic.SerialNumber, serial ?? 'N/A')
@@ -626,7 +626,11 @@ export class ADTPulseAccessory {
626626

627627
// Find the state for "Security System Alarm Type" (optional characteristic).
628628
if (mode === 'alarmType') {
629-
if (isPanelAlarmActive(panelStatuses, this.#config?.options.includes('ignoreSensorProblemStatus') ?? false)) {
629+
if (isPanelAlarmActive(
630+
panelStatuses,
631+
this.#state.data.orbSecurityButtons,
632+
this.#config?.options.includes('ignoreSensorProblemStatus') ?? false,
633+
)) {
630634
return 1;
631635
}
632636

@@ -662,7 +666,11 @@ export class ADTPulseAccessory {
662666
switch (true) {
663667
case mode === 'current' && this.#activity.isBusy && this.#activity.setCurrentValue !== null:
664668
return this.#activity.setCurrentValue;
665-
case mode === 'current' && isPanelAlarmActive(panelStatuses, this.#config?.options.includes('ignoreSensorProblemStatus') ?? false):
669+
case mode === 'current' && isPanelAlarmActive(
670+
panelStatuses,
671+
this.#state.data.orbSecurityButtons,
672+
this.#config?.options.includes('ignoreSensorProblemStatus') ?? false,
673+
):
666674
return this.#characteristic.SecuritySystemCurrentState.ALARM_TRIGGERED;
667675
case mode === 'current' && panelStates.includes('Armed Stay'):
668676
return this.#characteristic.SecuritySystemCurrentState.STAY_ARM;
@@ -748,7 +756,11 @@ export class ADTPulseAccessory {
748756
}
749757

750758
// Only show as "On" if alarm is ringing.
751-
return isPanelAlarmActive(panelStatuses, this.#config?.options.includes('ignoreSensorProblemStatus') ?? false);
759+
return isPanelAlarmActive(
760+
panelStatuses,
761+
this.#state.data.orbSecurityButtons,
762+
this.#config?.options.includes('ignoreSensorProblemStatus') ?? false,
763+
);
752764
}
753765

754766
/**
@@ -798,7 +810,11 @@ export class ADTPulseAccessory {
798810
const { panelStates } = this.#state.data.panelStatus;
799811

800812
const condensedPanelStates = condensePanelStates(this.#characteristic, panelStates);
801-
const isAlarmActive = isPanelAlarmActive(this.#state.data.panelStatus.panelStatuses, this.#config?.options.includes('ignoreSensorProblemStatus') ?? false);
813+
const isAlarmActive = isPanelAlarmActive(
814+
this.#state.data.panelStatus.panelStatuses,
815+
this.#state.data.orbSecurityButtons,
816+
this.#config?.options.includes('ignoreSensorProblemStatus') ?? false,
817+
);
802818

803819
// If panel status cannot be found or most likely "Status Unavailable".
804820
if (condensedPanelStates === undefined) {
@@ -937,7 +953,11 @@ export class ADTPulseAccessory {
937953
const { panelStates } = this.#state.data.panelStatus;
938954

939955
const condensedPanelStates = condensePanelStates(this.#characteristic, panelStates);
940-
const isAlarmActive = isPanelAlarmActive(this.#state.data.panelStatus.panelStatuses, this.#config?.options.includes('ignoreSensorProblemStatus') ?? false);
956+
const isAlarmActive = isPanelAlarmActive(
957+
this.#state.data.panelStatus.panelStatuses,
958+
this.#state.data.orbSecurityButtons,
959+
this.#config?.options.includes('ignoreSensorProblemStatus') ?? false,
960+
);
941961

942962
// If panel status cannot be found or most likely "Status Unavailable".
943963
if (condensedPanelStates === undefined) {

0 commit comments

Comments
 (0)