Skip to content

Commit

Permalink
Minor changes and fixes
Browse files Browse the repository at this point in the history
### FIXED
- HOOBS devices are not able to start plugin due because it does not support the `exports` key in `package.json`

### ADDED
- Panic button for configuration UI

### NOTES
- HOOBS currently caches configuration UIs, so users won't be able to see the latest configuration UI. Please re-configure the plugin manually until this is fixed by the HOOBS team.
  • Loading branch information
mrjackyliang committed Dec 20, 2023
1 parent bd94cd9 commit caba4c1
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 15 deletions.
14 changes: 10 additions & 4 deletions config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,12 @@
"fire"
]
},
{
"title": "Water/Flood Sensor",
"enum": [
"flood"
]
},
{
"title": "Glass Break Detector",
"enum": [
Expand All @@ -194,15 +200,15 @@
]
},
{
"title": "Temperature Sensor",
"title": "Audible Panic Button/Pendant or Silent Panic Button/Pendant",
"enum": [
"temperature"
"panic"
]
},
{
"title": "Water/Flood Sensor",
"title": "Temperature Sensor",
"enum": [
"flood"
"temperature"
]
}
]
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "homebridge-adt-pulse",
"displayName": "Homebridge ADT Pulse",
"version": "3.0.0-beta.8",
"version": "3.0.0-beta.9",
"description": "Homebridge security system platform for ADT Pulse",
"main": "./build/src/index.js",
"exports": "./build/src/index.js",
"type": "module",
"private": false,
Expand Down
5 changes: 3 additions & 2 deletions src/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1861,9 +1861,10 @@ export class ADTPulse {
* NOTICE: Parts NOT SHOWN below will NOT be tracked, documented, or tested.
* PATENT: https://patents.google.com/patent/US20170070361A1/en
*
* deviceType: 'Door Sensor'
* 'Door/Window Sensor'
* deviceType: 'Audible Panic Button/Pendant'
* 'Carbon Monoxide Detector'
* 'Door/Window Sensor'
* 'Door Sensor'
* 'Fire (Smoke/Heat) Detector'
* 'Glass Break Detector'
* 'Keypad/Touchpad'
Expand Down
5 changes: 3 additions & 2 deletions src/lib/detect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -728,9 +728,10 @@ export async function detectedNewPortalVersion(version: DetectedNewPortalVersion
*/
export async function detectedNewSensorsInformation(sensors: DetectedNewSensorsInformationSensors, logger: DetectedNewSensorsInformationLogger, debugMode: DetectedNewSensorsInformationDebugMode): DetectedNewSensorsInformationReturns {
const knownDeviceTypes: DetectedNewSensorsInformationKnownDeviceTypes = [
'Door Sensor',
'Door/Window Sensor',
'Audible Panic Button/Pendant',
'Carbon Monoxide Detector',
'Door/Window Sensor',
'Door Sensor',
'Fire (Smoke/Heat) Detector',
'Glass Break Detector',
'Keypad/Touchpad',
Expand Down
10 changes: 6 additions & 4 deletions src/lib/utility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,18 +150,22 @@ export function clearWhitespace(data: ClearWhitespaceData): ClearWhitespaceRetur
export function condenseSensorType(sensorType: CondenseSensorTypeSensorType): CondenseSensorTypeReturns {
let condensed: CondenseSensorTypeCondensed;

// Sort by "condensed" first, then switch cases, both in alphabet order.
switch (sensorType) {
case 'Carbon Monoxide Detector':
condensed = 'co';
break;
case 'Door/Window Sensor':
case 'Door Sensor':
case 'Window Sensor':
case 'Door/Window Sensor':
condensed = 'doorWindow';
break;
case 'Fire (Smoke/Heat) Detector':
condensed = 'fire';
break;
case 'Water/Flood Sensor':
condensed = 'flood';
break;
case 'Glass Break Detector':
condensed = 'glass';
break;
Expand All @@ -172,15 +176,13 @@ export function condenseSensorType(sensorType: CondenseSensorTypeSensorType): Co
case 'Motion Sensor (Notable Events Only)':
condensed = 'motion';
break;
case 'Audible Panic Button/Pendant':
case 'Silent Panic Button/Pendant':
condensed = 'panic';
break;
case 'Temperature Sensor':
condensed = 'temperature';
break;
case 'Water/Flood Sensor':
condensed = 'flood';
break;
default:
break;
}
Expand Down
5 changes: 3 additions & 2 deletions src/types/constant.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,10 @@ export type PortalPanelStatusSensorsOpen =
* @since 1.0.0
*/
export type PortalSensorDeviceType =
'Door Sensor'
| 'Door/Window Sensor'
'Audible Panic Button/Pendant'
| 'Carbon Monoxide Detector'
| 'Door/Window Sensor'
| 'Door Sensor'
| 'Fire (Smoke/Heat) Detector'
| 'Glass Break Detector'
| 'Keypad/Touchpad'
Expand Down

0 comments on commit caba4c1

Please sign in to comment.