Skip to content

Commit

Permalink
Additional fixes for sensor info mis-match
Browse files Browse the repository at this point in the history
### UPDATED
- Re-written the detection method for sensors information.

### FIXED
- Some type definitions were incorrectly ending with `,` instead of `;`.

### REMOVED
- Support for some devices previously matched as sensors (`keypad`, `panic`, `remote`).
- Temporarily removed "System/Supervisory" and "Unknown Device Type" to determine the legitimacy of these sensors.
- `rawNode` when parsing the orb text summary.

v3.0.0-beta.22
  • Loading branch information
mrjackyliang committed Jan 8, 2024
1 parent fb4106b commit 17e277f
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 216 deletions.
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,9 @@ This plugin can expose these devices (in read-only mode) based on your configura
4. `flood` - Water/Flood Sensor
5. `glass` - Glass Break Detector
6. `heat` - Heat (Rate-of-Rise) Detector
7. `keypad` - Keypad/Touchpad
8. `motion` - Motion Sensor __::__ Motion Sensor (Notable Events Only)
9. `panic` - Audible Panic Button/Pendant __::__ Silent Panic Button/Pendant
10. `remote` - Wireless Remote
11. `shock` - Shock Sensor
12. `supervisory` - System/Supervisory
13. `temperature` - Temperature Sensor
14. `unknown` - Unknown Device Type
7. `motion` - Motion Sensor __::__ Motion Sensor (Notable Events Only)
8. `shock` - Shock Sensor
9. `temperature` - Temperature Sensor

Due to implementation complexity and platform instability, all Z-Wave accessories connected to the ADT Pulse gateway will not be planned for development or be supported overall. Consider purchasing the [Hubitat Hub](https://hubitat.com) for a seamless setup experience, or read about the [Home Assistant Z-Wave](https://www.home-assistant.io/integrations/zwave_js/) integration.

Expand Down
30 changes: 0 additions & 30 deletions config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,53 +193,23 @@
"heat"
]
},
{
"title": "Keypad/Touchpad",
"enum": [
"keypad"
]
},
{
"title": "Motion Sensor :: Motion Sensor (Notable Events Only)",
"enum": [
"motion"
]
},
{
"title": "Audible Panic Button/Pendant :: Silent Panic Button/Pendant",
"enum": [
"panic"
]
},
{
"title": "Wireless Remote",
"enum": [
"remote"
]
},
{
"title": "Shock Sensor",
"enum": [
"shock"
]
},
{
"title": "System/Supervisory",
"enum": [
"supervisory"
]
},
{
"title": "Temperature Sensor",
"enum": [
"temperature"
]
},
{
"title": "Unknown Device Type",
"enum": [
"unknown"
]
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion 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.0-beta.21",
"version": "3.0.0-beta.22",
"description": "Homebridge security system platform for ADT Pulse",
"main": "./build/src/index.js",
"exports": "./build/src/index.js",
Expand Down
55 changes: 0 additions & 55 deletions src/lib/accessory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,30 +179,15 @@ export class ADTPulseAccessory {
case 'heat':
this.#services.Primary = this.#accessory.getService(service.OccupancySensor) ?? this.#accessory.addService(service.OccupancySensor);
break;
case 'keypad':
this.#services.Primary = this.#accessory.getService(service.OccupancySensor) ?? this.#accessory.addService(service.OccupancySensor);
break;
case 'motion':
this.#services.Primary = this.#accessory.getService(service.MotionSensor) ?? this.#accessory.addService(service.MotionSensor);
break;
case 'panic':
this.#services.Primary = this.#accessory.getService(service.OccupancySensor) ?? this.#accessory.addService(service.OccupancySensor);
break;
case 'remote':
this.#services.Primary = this.#accessory.getService(service.OccupancySensor) ?? this.#accessory.addService(service.OccupancySensor);
break;
case 'shock':
this.#services.Primary = this.#accessory.getService(service.OccupancySensor) ?? this.#accessory.addService(service.OccupancySensor);
break;
case 'supervisory':
this.#services.Primary = this.#accessory.getService(service.OccupancySensor) ?? this.#accessory.addService(service.OccupancySensor);
break;
case 'temperature':
this.#services.Primary = this.#accessory.getService(service.TemperatureSensor) ?? this.#accessory.addService(service.TemperatureSensor);
break;
case 'unknown':
this.#services.Primary = this.#accessory.getService(service.OccupancySensor) ?? this.#accessory.addService(service.OccupancySensor);
break;
default:
break;
}
Expand Down Expand Up @@ -263,38 +248,18 @@ export class ADTPulseAccessory {
this.#services.Primary.getCharacteristic(this.#characteristic.OccupancyDetected)
.updateValue(this.getSensorStatus('status', context));
break;
case 'keypad':
this.#services.Primary.getCharacteristic(this.#characteristic.OccupancyDetected)
.updateValue(this.getSensorStatus('status', context));
break;
case 'motion':
this.#services.Primary.getCharacteristic(this.#characteristic.MotionDetected)
.updateValue(this.getSensorStatus('status', context));
break;
case 'panic':
this.#services.Primary.getCharacteristic(this.#characteristic.OccupancyDetected)
.updateValue(this.getSensorStatus('status', context));
break;
case 'remote':
this.#services.Primary.getCharacteristic(this.#characteristic.OccupancyDetected)
.updateValue(this.getSensorStatus('status', context));
break;
case 'shock':
this.#services.Primary.getCharacteristic(this.#characteristic.OccupancyDetected)
.updateValue(this.getSensorStatus('status', context));
break;
case 'supervisory':
this.#services.Primary.getCharacteristic(this.#characteristic.OccupancyDetected)
.updateValue(this.getSensorStatus('status', context));
break;
case 'temperature':
this.#services.Primary.getCharacteristic(this.#characteristic.CurrentTemperature)
.updateValue(this.getSensorStatus('status', context));
break;
case 'unknown':
this.#services.Primary.getCharacteristic(this.#characteristic.OccupancyDetected)
.updateValue(this.getSensorStatus('status', context));
break;
default:
break;
}
Expand Down Expand Up @@ -326,14 +291,9 @@ export class ADTPulseAccessory {
case 'flood':
case 'glass':
case 'heat':
case 'keypad':
case 'motion':
case 'panic':
case 'remote':
case 'shock':
case 'supervisory':
case 'temperature':
case 'unknown':
this.#services.Primary.getCharacteristic(this.#characteristic.StatusActive)
.updateValue(this.getSensorStatus('active', context));

Expand Down Expand Up @@ -476,9 +436,6 @@ export class ADTPulseAccessory {
case 'heat':
// TODO: Nothing done here yet.
break;
case 'keypad':
// TODO: Nothing done here yet.
break;
case 'motion':
if (statuses.includes('No Motion') || statuses.includes('Okay')) {
return false;
Expand All @@ -488,24 +445,12 @@ export class ADTPulseAccessory {
return true;
}
break;
case 'panic':
// TODO: Nothing done here yet.
break;
case 'remote':
// TODO: Nothing done here yet.
break;
case 'shock':
// TODO: Nothing done here yet.
break;
case 'supervisory':
// TODO: Nothing done here yet.
break;
case 'temperature':
// TODO: Nothing done here yet.
break;
case 'unknown':
// TODO: Nothing done here yet.
break;
default:
break;
}
Expand Down
10 changes: 2 additions & 8 deletions src/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1860,7 +1860,7 @@ export class ADTPulse {
*
* @since 1.0.0
*/
const jsdomSystemSensorsTable = sessions.jsdomSystem.window.document.querySelectorAll('#systemContentList tr[onclick^="goToUrl(\'device.jsp?id="]');
const jsdomSystemSensorsTable = sessions.jsdomSystem.window.document.querySelectorAll('#systemContentList tr[class^=\'p_row\'] tr.p_listRow');
const parsedSensorsTable = parseSensorsTable(jsdomSystemSensorsTable);

/**
Expand All @@ -1869,24 +1869,18 @@ export class ADTPulse {
* NOTICE: Parts NOT SHOWN below will NOT be tracked, documented, or tested.
* PATENT: https://patents.google.com/patent/US20170070361A1/en
*
* deviceType: 'Audible Panic Button/Pendant'
* 'Carbon Monoxide Detector'
* deviceType: 'Carbon Monoxide Detector'
* 'Door/Window Sensor'
* 'Door Sensor'
* 'Fire (Smoke/Heat) Detector'
* 'Glass Break Detector'
* 'Heat (Rate-of-Rise) Detector'
* 'Keypad/Touchpad'
* 'Motion Sensor'
* 'Motion Sensor (Notable Events Only)'
* 'Shock Sensor'
* 'Silent Panic Button/Pendant'
* 'System/Supervisory'
* 'Temperature Sensor'
* 'Unknown Device Type'
* 'Water/Flood Sensor'
* 'Window Sensor'
* 'Wireless Remote'
*
* status: 'Installing'
* 'Offline'
Expand Down
41 changes: 0 additions & 41 deletions src/lib/items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,9 @@ export const condensedSensorTypeItems: CondensedSensorTypeItems = [
'flood',
'glass',
'heat',
'keypad',
'motion',
'panic',
'remote',
'shock',
'supervisory',
'temperature',
'unknown',
];

/**
Expand Down Expand Up @@ -307,12 +302,6 @@ export const sensorActionItems: SensorActionItems = [
'',
],
},
{
type: 'keypad',
statuses: [
'',
],
},
{
type: 'motion',
statuses: [
Expand All @@ -321,42 +310,18 @@ export const sensorActionItems: SensorActionItems = [
'Okay',
],
},
{
type: 'panic',
statuses: [
'',
],
},
{
type: 'remote',
statuses: [
'',
],
},
{
type: 'shock',
statuses: [
'',
],
},
{
type: 'supervisory',
statuses: [
'',
],
},
{
type: 'temperature',
statuses: [
'',
],
},
{
type: 'unknown',
statuses: [
'',
],
},
];

/**
Expand All @@ -365,24 +330,18 @@ export const sensorActionItems: SensorActionItems = [
* @since 1.0.0
*/
export const sensorInformationDeviceTypeItems: SensorInformationDeviceTypeItems = [
'Audible Panic Button/Pendant',
'Carbon Monoxide Detector',
'Door/Window Sensor',
'Door Sensor',
'Fire (Smoke/Heat) Detector',
'Glass Break Detector',
'Heat (Rate-of-Rise) Detector',
'Keypad/Touchpad',
'Motion Sensor',
'Motion Sensor (Notable Events Only)',
'Shock Sensor',
'Silent Panic Button/Pendant',
'System/Supervisory',
'Temperature Sensor',
'Unknown Device Type',
'Water/Flood Sensor',
'Window Sensor',
'Wireless Remote',
];

/**
Expand Down
5 changes: 0 additions & 5 deletions src/lib/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,9 @@ export const platformConfig = z.object({
z.literal('flood'),
z.literal('glass'),
z.literal('heat'),
z.literal('keypad'),
z.literal('motion'),
z.literal('panic'),
z.literal('remote'),
z.literal('shock'),
z.literal('supervisory'),
z.literal('temperature'),
z.literal('unknown'),
]),
adtZone: z.number().min(1).max(999),
})).min(0).max(148),
Expand Down
Loading

0 comments on commit 17e277f

Please sign in to comment.