Skip to content

Commit

Permalink
Minor enhancements
Browse files Browse the repository at this point in the history
### UPDATED
- CO alarm statuses have been manually tested and confirmed.
- Plugin will no longer send detector status if it sees a mismatch between the "sensorsInfo" and "sensorsStatus" if it sees that the `sensorsInfo` is empty and `sensorsStatus` isn't and vice versa.
- Made some documentations concerning "Sensor Problem" or "Sensor Problems" constantly making status show as "Triggered" in the Home app.

### FIXED
- Removed the `publish` script since it causes weird issues to happen when doing `npm install` or `npm publish`.
  • Loading branch information
mrjackyliang committed Jan 25, 2024
1 parent b7e6bc4 commit 89e4ac6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "homebridge-adt-pulse",
"displayName": "Homebridge ADT Pulse",
"version": "3.0.5",
"version": "3.0.6",
"description": "Homebridge security system platform for ADT Pulse",
"main": "./build/index.js",
"exports": "./build/index.js",
Expand All @@ -18,8 +18,7 @@
"repl": "node ./build/scripts/repl.js",
"test-api": "node ./build/scripts/test-api.js",
"prepare": "npm run build",
"prepublishOnly": "npm run build",
"publish": "npm publish"
"prepublishOnly": "npm run build"
},
"types": "",
"repository": {
Expand Down
1 change: 0 additions & 1 deletion src/lib/accessory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,6 @@ export class ADTPulseAccessory {

// Find the state for the sensor (required characteristic).
switch (type) {
// TODO Device type needs to be manually tested and confirmed first.
case 'co':
if (statuses.includes('ALARM') || statuses.includes('Tripped')) {
return this.#characteristic.CarbonMonoxideDetected.CO_LEVELS_ABNORMAL;
Expand Down
7 changes: 5 additions & 2 deletions src/lib/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -985,8 +985,11 @@ export class ADTPulsePlatform implements ADTPulsePlatformPlugin {
private async unknownInformationDispatcher(): ADTPulsePlatformUnknownInformationDispatcherReturns {
const { sensorsInfo, sensorsStatus } = this.#state.data;

// Check if there was a mismatch between the "sensorsInfo" and "sensorsStatus" array.
if (sensorsInfo.length !== sensorsStatus.length) {
if (
sensorsInfo.length !== sensorsStatus.length // Check if there was a mismatch between the "sensorsInfo" and "sensorsStatus" array.
&& !(sensorsInfo.length === 0 && sensorsStatus.length > 0) // Sometimes devices are slow to fetch sensors information.
&& !(sensorsInfo.length > 0 && sensorsStatus.length === 0) // Sometimes devices are slow to fetch sensors status.
) {
const data = {
sensorsInfo,
sensorsStatus,
Expand Down
4 changes: 2 additions & 2 deletions src/lib/utility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -872,8 +872,8 @@ export function isPanelAlarmActive(panelStatuses: IsPanelAlarmActivePanelStatuse
panelStatuses.includes('BURGLARY ALARM')
|| panelStatuses.includes('Carbon Monoxide Alarm')
|| panelStatuses.includes('FIRE ALARM')
|| panelStatuses.includes('Sensor Problem')
|| panelStatuses.includes('Sensor Problems')
|| panelStatuses.includes('Sensor Problem') // User must fix the sensor issue before "Triggered" in Home app will go away.
|| panelStatuses.includes('Sensor Problems') // User must fix the sensor issue before "Triggered" in Home app will go away.
|| panelStatuses.includes('Uncleared Alarm')
|| panelStatuses.includes('WATER ALARM')
);
Expand Down

0 comments on commit 89e4ac6

Please sign in to comment.