homebridge-adt-pulse 3.0.0-beta.4 → 3.0.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -8
- package/build/config.schema.json +308 -0
- package/build/src/index.js +6 -0
- package/build/src/index.js.map +1 -0
- package/build/src/lib/accessory.js +216 -0
- package/build/src/lib/accessory.js.map +1 -0
- package/build/src/lib/api.js +1876 -0
- package/build/src/lib/api.js.map +1 -0
- package/build/src/lib/detect.js +443 -0
- package/build/src/lib/detect.js.map +1 -0
- package/build/src/lib/platform.js +446 -0
- package/build/src/lib/platform.js.map +1 -0
- package/{src/lib/regex.ts → build/src/lib/regex.js} +1 -143
- package/build/src/lib/regex.js.map +1 -0
- package/build/src/lib/schema.js +38 -0
- package/build/src/lib/schema.js.map +1 -0
- package/build/src/lib/utility.js +434 -0
- package/build/src/lib/utility.js.map +1 -0
- package/build/src/scripts/repl.js +173 -0
- package/build/src/scripts/repl.js.map +1 -0
- package/build/src/scripts/test-api.js +171 -0
- package/build/src/scripts/test-api.js.map +1 -0
- package/config.schema.json +289 -218
- package/package.json +5 -6
- package/src/index.ts +0 -18
- package/src/lib/accessory.ts +0 -405
- package/src/lib/api.ts +0 -3483
- package/src/lib/detect.ts +0 -728
- package/src/lib/platform.ts +0 -890
- package/src/lib/schema.ts +0 -34
- package/src/lib/utility.ts +0 -933
- package/src/scripts/repl.ts +0 -300
- package/src/scripts/test-api.ts +0 -278
- package/src/types/constant.d.ts +0 -308
- package/src/types/index.d.ts +0 -1472
- package/src/types/shared.d.ts +0 -517
- package/tsconfig.json +0 -32
package/README.md
CHANGED
|
@@ -11,7 +11,6 @@ This is a [verified Homebridge plugin](https://github.com/homebridge/homebridge/
|
|
|
11
11
|
# Please install the beta version!
|
|
12
12
|
### This plugin is completely re-written from the ground up, and I need everyone on board! Please install the pre-release version, so I can quickly get a faster and more stable version to you!
|
|
13
13
|
### Everything is still very sloppy, please bear with me, even the readme has to be re-written.
|
|
14
|
-
### In the meantime, do not use the UI to configure your plugin (the latest config is below). The UI uses v2 (this is now v3) config. All sensors will now HAVE TO be added manually to prevent automatic-adding/removals if ADT strikes a bug to break things again.
|
|
15
14
|
|
|
16
15
|
To use this plugin, here are three simple steps you need to follow:
|
|
17
16
|
1. Run `npm install homebridge-adt-pulse`
|
|
@@ -28,10 +27,12 @@ When configuring this plugin, simply add the platform to your existing `config.j
|
|
|
28
27
|
{
|
|
29
28
|
"platform": "ADTPulse",
|
|
30
29
|
"name": "ADT Pulse",
|
|
31
|
-
"subdomain": "
|
|
32
|
-
"username": "
|
|
33
|
-
"password": "
|
|
34
|
-
"fingerprint": "
|
|
30
|
+
"subdomain": "portal",
|
|
31
|
+
"username": "user@example.com",
|
|
32
|
+
"password": "Mys7r0nG!P@ssw0rd",
|
|
33
|
+
"fingerprint": "VGhpc0lzQVNlY3VyZVBhc3N3b3JkMTIzIQ==",
|
|
34
|
+
"mode": "normal",
|
|
35
|
+
"speed": 1,
|
|
35
36
|
"sensors": [
|
|
36
37
|
{
|
|
37
38
|
"name": "Lounge Smoke",
|
|
@@ -39,9 +40,7 @@ When configuring this plugin, simply add the platform to your existing `config.j
|
|
|
39
40
|
"adtType": "fire",
|
|
40
41
|
"adtZone": 1
|
|
41
42
|
}
|
|
42
|
-
]
|
|
43
|
-
"pause": false,
|
|
44
|
-
"reset": false
|
|
43
|
+
]
|
|
45
44
|
},
|
|
46
45
|
{
|
|
47
46
|
"platform": "...",
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
{
|
|
2
|
+
"pluginAlias": "ADTPulse",
|
|
3
|
+
"pluginType": "platform",
|
|
4
|
+
"singular": true,
|
|
5
|
+
"headerDisplay": "Welcome to the configuration page for **[ADT Pulse for Homebridge](https://github.com/mrjackyliang/homebridge-adt-pulse)**! You will find customizable settings to tailor your experience here. Start by inputting your login credentials, and then specify the sensors you want to incorporate into this setup.",
|
|
6
|
+
"footerDisplay": "For further assistance, please consult the [readme](https://github.com/mrjackyliang/homebridge-adt-pulse#readme) file. Should you encounter any issues, such as crashes or unexpected results, please [create a new issue](https://github.com/mrjackyliang/homebridge-adt-pulse/issues/new/choose) on GitHub.",
|
|
7
|
+
"schema": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {
|
|
10
|
+
"name": {
|
|
11
|
+
"title": "Name",
|
|
12
|
+
"type": "string",
|
|
13
|
+
"required": true,
|
|
14
|
+
"description": "Enter a unique name for this plugin. The name will mainly be used for identification purposes, such as in Homebridge logs.",
|
|
15
|
+
"default": "ADT Pulse",
|
|
16
|
+
"placeholder": "ADT Pulse",
|
|
17
|
+
"minLength": 1,
|
|
18
|
+
"maxLength": 50
|
|
19
|
+
},
|
|
20
|
+
"subdomain": {
|
|
21
|
+
"title": "Portal Region",
|
|
22
|
+
"type": "string",
|
|
23
|
+
"required": true,
|
|
24
|
+
"description": "Select the portal region based on where you are subscribed in. For subscribers in Canada, choose \"Canada\" from the dropdown menu.",
|
|
25
|
+
"oneOf": [
|
|
26
|
+
{
|
|
27
|
+
"title": "United States \uD83C\uDDFA\uD83C\uDDF8 - portal.adtpulse.com</span>",
|
|
28
|
+
"enum": [
|
|
29
|
+
"portal"
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"title": "Canada \uD83C\uDDE8\uD83C\uDDE6 - portal-ca.adtpulse.com",
|
|
34
|
+
"enum": [
|
|
35
|
+
"portal-ca"
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"default": "portal"
|
|
40
|
+
},
|
|
41
|
+
"username": {
|
|
42
|
+
"title": "Username",
|
|
43
|
+
"type": "string",
|
|
44
|
+
"required": true,
|
|
45
|
+
"description": "Provide the username you use to login to the portal.",
|
|
46
|
+
"placeholder": "e.g. user@example.com",
|
|
47
|
+
"minLength": 1,
|
|
48
|
+
"maxLength": 100
|
|
49
|
+
},
|
|
50
|
+
"password": {
|
|
51
|
+
"title": "Password",
|
|
52
|
+
"type": "string",
|
|
53
|
+
"required": true,
|
|
54
|
+
"description": "Provide the password you use to login to the portal.",
|
|
55
|
+
"placeholder": "e.g. Mys7r0nG!P@ssw0rd",
|
|
56
|
+
"minLength": 1,
|
|
57
|
+
"maxLength": 300
|
|
58
|
+
},
|
|
59
|
+
"fingerprint": {
|
|
60
|
+
"title": "Fingerprint",
|
|
61
|
+
"type": "string",
|
|
62
|
+
"required": true,
|
|
63
|
+
"description": "After logging in and selecting \"Trust this device\", paste in the device fingerprint generated through the <a href=\"https://raw.githack.com/mrjackyliang/homebridge-adt-pulse/main/fingerprint/index.html\" target=\"_blank\">ADT Pulse Device Fingerprint Detector</a>.",
|
|
64
|
+
"placeholder": "e.g. VGhpc0lzQVNlY3VyZVBhc3N3b3JkMTIzIQ==",
|
|
65
|
+
"minLength": 1,
|
|
66
|
+
"maxLength": 5120
|
|
67
|
+
},
|
|
68
|
+
"mode": {
|
|
69
|
+
"title": "Operational Mode",
|
|
70
|
+
"type": "string",
|
|
71
|
+
"required": true,
|
|
72
|
+
"description": "Choose the operational mode for the plugin. Debug mode is enabled only when Homebridge debug mode is on; there is no separate setting for this.",
|
|
73
|
+
"oneOf": [
|
|
74
|
+
{
|
|
75
|
+
"title": "Normal",
|
|
76
|
+
"enum": [
|
|
77
|
+
"normal"
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"title": "Paused",
|
|
82
|
+
"enum": [
|
|
83
|
+
"paused"
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"title": "Reset (danger)",
|
|
88
|
+
"enum": [
|
|
89
|
+
"reset"
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
"default": "normal"
|
|
94
|
+
},
|
|
95
|
+
"speed": {
|
|
96
|
+
"title": "Operational Speed",
|
|
97
|
+
"type": "number",
|
|
98
|
+
"required": true,
|
|
99
|
+
"description": "Choose the operational speed for the plugin. Designed to enhance the performance of devices with older hardware. May result in slower device updates.",
|
|
100
|
+
"oneOf": [
|
|
101
|
+
{
|
|
102
|
+
"title": "Normal Speed (1x)",
|
|
103
|
+
"enum": [
|
|
104
|
+
1
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"title": "Moderate Speed (0.75x)",
|
|
109
|
+
"enum": [
|
|
110
|
+
0.75
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"title": "Slower Speed (0.5x)",
|
|
115
|
+
"enum": [
|
|
116
|
+
0.5
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"title": "Slowest Speed (0.25x)",
|
|
121
|
+
"enum": [
|
|
122
|
+
0.25
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
"default": 1
|
|
127
|
+
},
|
|
128
|
+
"sensors": {
|
|
129
|
+
"title": "Sensors",
|
|
130
|
+
"type": "array",
|
|
131
|
+
"required": true,
|
|
132
|
+
"description": "Define your sensors here. Sensors include devices like \"Door/Window Sensor\" or \"Motion Sensor\". <strong class=\"font-weight-bold\">Please note that Z-Wave accessories are not supported.</strong> Ensure at least one sensor is specified for proper functionality.",
|
|
133
|
+
"items": {
|
|
134
|
+
"type": "object",
|
|
135
|
+
"properties": {
|
|
136
|
+
"name": {
|
|
137
|
+
"title": "Name",
|
|
138
|
+
"type": "string",
|
|
139
|
+
"required": false,
|
|
140
|
+
"description": "<strong class=\"font-weight-bold\">Optional.</strong> Provide a display name for this sensor to differentiate it from the names assigned by ADT technicians during installation.",
|
|
141
|
+
"placeholder": "e.g. Family Room Couch Window 1",
|
|
142
|
+
"minLength": 1,
|
|
143
|
+
"maxLength": 50
|
|
144
|
+
},
|
|
145
|
+
"adtName": {
|
|
146
|
+
"title": "ADT Sensor Name",
|
|
147
|
+
"type": "string",
|
|
148
|
+
"required": true,
|
|
149
|
+
"description": "Specify the <strong class=\"font-weight-bold\">exact name</strong> associated with the sensor you want to add. Double-check the names to ensure they don't include extra characters when copying and pasting.",
|
|
150
|
+
"placeholder": "e.g. Family Room Window (99)",
|
|
151
|
+
"minLength": 1,
|
|
152
|
+
"maxLength": 100
|
|
153
|
+
},
|
|
154
|
+
"adtType": {
|
|
155
|
+
"title": "ADT Sensor Type",
|
|
156
|
+
"type": "string",
|
|
157
|
+
"required": true,
|
|
158
|
+
"description": "Select the <strong class=\"font-weight-bold\">type</strong> associated with the sensor you want to add. Ensure your selection matches the sensor type, as selecting the wrong type may lead to incorrect status detection.",
|
|
159
|
+
"oneOf": [
|
|
160
|
+
{
|
|
161
|
+
"title": "Carbon Monoxide Detector",
|
|
162
|
+
"enum": [
|
|
163
|
+
"co"
|
|
164
|
+
]
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"title": "Door/Window Sensor / Door Sensor / Window Sensor",
|
|
168
|
+
"enum": [
|
|
169
|
+
"doorWindow"
|
|
170
|
+
]
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"title": "Fire (Smoke/Heat) Detector",
|
|
174
|
+
"enum": [
|
|
175
|
+
"fire"
|
|
176
|
+
]
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"title": "Glass Break Detector",
|
|
180
|
+
"enum": [
|
|
181
|
+
"glass"
|
|
182
|
+
]
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"title": "Motion Sensor / Motion Sensor (Notable Events Only)",
|
|
186
|
+
"enum": [
|
|
187
|
+
"motion"
|
|
188
|
+
]
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"title": "Temperature Sensor",
|
|
192
|
+
"enum": [
|
|
193
|
+
"temperature"
|
|
194
|
+
]
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"title": "Water/Flood Sensor",
|
|
198
|
+
"enum": [
|
|
199
|
+
"flood"
|
|
200
|
+
]
|
|
201
|
+
}
|
|
202
|
+
]
|
|
203
|
+
},
|
|
204
|
+
"adtZone": {
|
|
205
|
+
"title": "ADT Sensor Zone",
|
|
206
|
+
"type": "number",
|
|
207
|
+
"required": true,
|
|
208
|
+
"description": "Specify the <strong class=\"font-weight-bold\">exact zone</strong> associated with the sensor you want to add. Double-check the zone to ensure the correct sensor is added.",
|
|
209
|
+
"placeholder": "e.g. 99",
|
|
210
|
+
"minimum": 1,
|
|
211
|
+
"maximum": 99
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
"minItems": 1,
|
|
216
|
+
"maxItems": 148
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
"layout": [
|
|
221
|
+
{
|
|
222
|
+
"type": "tabs",
|
|
223
|
+
"tabs": [
|
|
224
|
+
{
|
|
225
|
+
"title": "General",
|
|
226
|
+
"htmlClass": "px-3 pt-3 pb-0",
|
|
227
|
+
"items": [
|
|
228
|
+
{
|
|
229
|
+
"key": "name",
|
|
230
|
+
"type": "text"
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"key": "mode",
|
|
234
|
+
"type": "select"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"key": "speed",
|
|
238
|
+
"type": "select"
|
|
239
|
+
}
|
|
240
|
+
]
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"title": "Login",
|
|
244
|
+
"htmlClass": "px-3 pt-3 pb-0",
|
|
245
|
+
"items": [
|
|
246
|
+
{
|
|
247
|
+
"key": "subdomain",
|
|
248
|
+
"type": "select"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"key": "username",
|
|
252
|
+
"type": "text"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"key": "password",
|
|
256
|
+
"type": "password"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"key": "fingerprint",
|
|
260
|
+
"type": "password"
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"type": "help",
|
|
264
|
+
"helpvalue": "<div class=\"alert alert-primary\" role=\"alert\">If you wish, you can optionally view the \"Device Details\" tab to see what information the device fingerprint contains about your browser.</div>"
|
|
265
|
+
}
|
|
266
|
+
]
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"title": "Devices",
|
|
270
|
+
"htmlClass": "px-3 pt-3 pb-0",
|
|
271
|
+
"items": [
|
|
272
|
+
{
|
|
273
|
+
"key": "sensors",
|
|
274
|
+
"htmlClass": "p-10",
|
|
275
|
+
"buttonText": "Add Sensor",
|
|
276
|
+
"items": [
|
|
277
|
+
{
|
|
278
|
+
"type": "div",
|
|
279
|
+
"htmlClass": "my-3",
|
|
280
|
+
"items": [
|
|
281
|
+
{
|
|
282
|
+
"key": "sensors[].name",
|
|
283
|
+
"type": "text"
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"key": "sensors[].adtName",
|
|
287
|
+
"type": "text"
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"key": "sensors[].adtType",
|
|
291
|
+
"type": "select"
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
"key": "sensors[].adtZone",
|
|
295
|
+
"type": "number"
|
|
296
|
+
}
|
|
297
|
+
]
|
|
298
|
+
}
|
|
299
|
+
]
|
|
300
|
+
}
|
|
301
|
+
]
|
|
302
|
+
}
|
|
303
|
+
]
|
|
304
|
+
}
|
|
305
|
+
],
|
|
306
|
+
"form": null,
|
|
307
|
+
"display": null
|
|
308
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAYrD,SAAS,UAAU,CAAC,GAAkB;IACpC,GAAG,CAAC,gBAAgB,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;AACrD,CAAC;AAGD,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
export class ADTPulseAccessory {
|
|
2
|
+
#accessory;
|
|
3
|
+
#api;
|
|
4
|
+
#characteristic;
|
|
5
|
+
#instance;
|
|
6
|
+
#log;
|
|
7
|
+
#services;
|
|
8
|
+
#state;
|
|
9
|
+
constructor(accessory, state, instance, service, characteristic, api, log) {
|
|
10
|
+
this.#accessory = accessory;
|
|
11
|
+
this.#api = api;
|
|
12
|
+
this.#characteristic = characteristic;
|
|
13
|
+
this.#instance = instance;
|
|
14
|
+
this.#log = log;
|
|
15
|
+
this.#services = {};
|
|
16
|
+
this.#state = state;
|
|
17
|
+
this.#services.Information = this.#accessory.getService(service.AccessoryInformation) ?? this.#accessory.addService(service.AccessoryInformation);
|
|
18
|
+
this.#services.Information
|
|
19
|
+
.setCharacteristic(this.#characteristic.Identify, false)
|
|
20
|
+
.setCharacteristic(this.#characteristic.Manufacturer, accessory.context.manufacturer ?? 'ADT')
|
|
21
|
+
.setCharacteristic(this.#characteristic.Model, accessory.context.model ?? 'N/A')
|
|
22
|
+
.setCharacteristic(this.#characteristic.Name, accessory.context.name)
|
|
23
|
+
.setCharacteristic(this.#characteristic.SerialNumber, accessory.context.serial ?? 'N/A')
|
|
24
|
+
.setCharacteristic(this.#characteristic.FirmwareRevision, accessory.context.firmware ?? 'N/A')
|
|
25
|
+
.setCharacteristic(this.#characteristic.HardwareRevision, accessory.context.hardware ?? 'N/A')
|
|
26
|
+
.setCharacteristic(this.#characteristic.SoftwareRevision, accessory.context.software ?? 'N/A');
|
|
27
|
+
switch (accessory.context.type) {
|
|
28
|
+
case 'co':
|
|
29
|
+
this.#services.Primary = this.#accessory.getService(service.CarbonMonoxideSensor) ?? this.#accessory.addService(service.CarbonMonoxideSensor);
|
|
30
|
+
break;
|
|
31
|
+
case 'doorWindow':
|
|
32
|
+
this.#services.Primary = this.#accessory.getService(service.ContactSensor) ?? this.#accessory.addService(service.ContactSensor);
|
|
33
|
+
break;
|
|
34
|
+
case 'fire':
|
|
35
|
+
this.#services.Primary = this.#accessory.getService(service.SmokeSensor) ?? this.#accessory.addService(service.SmokeSensor);
|
|
36
|
+
break;
|
|
37
|
+
case 'flood':
|
|
38
|
+
this.#services.Primary = this.#accessory.getService(service.LeakSensor) ?? this.#accessory.addService(service.LeakSensor);
|
|
39
|
+
break;
|
|
40
|
+
case 'gateway':
|
|
41
|
+
break;
|
|
42
|
+
case 'glass':
|
|
43
|
+
this.#services.Primary = this.#accessory.getService(service.MotionSensor) ?? this.#accessory.addService(service.MotionSensor);
|
|
44
|
+
break;
|
|
45
|
+
case 'motion':
|
|
46
|
+
this.#services.Primary = this.#accessory.getService(service.MotionSensor) ?? this.#accessory.addService(service.MotionSensor);
|
|
47
|
+
break;
|
|
48
|
+
case 'panel':
|
|
49
|
+
this.#services.Primary = this.#accessory.getService(service.SecuritySystem) ?? this.#accessory.addService(service.SecuritySystem);
|
|
50
|
+
break;
|
|
51
|
+
case 'temperature':
|
|
52
|
+
this.#services.Primary = this.#accessory.getService(service.TemperatureSensor) ?? this.#accessory.addService(service.TemperatureSensor);
|
|
53
|
+
break;
|
|
54
|
+
default:
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
if (this.#services.Primary === undefined) {
|
|
58
|
+
if (accessory.context.type !== 'gateway') {
|
|
59
|
+
this.#log.error(`Failed to initialize ${accessory.context.name} (id: ${accessory.context.id}, uuid: ${accessory.context.uuid}) accessory services ...`);
|
|
60
|
+
}
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
switch (accessory.context.type) {
|
|
64
|
+
case 'co':
|
|
65
|
+
this.#services.Primary.getCharacteristic(this.#characteristic.CarbonMonoxideDetected)
|
|
66
|
+
.onGet(() => this.getSensorStatus(accessory.context));
|
|
67
|
+
break;
|
|
68
|
+
case 'doorWindow':
|
|
69
|
+
this.#services.Primary.getCharacteristic(this.#characteristic.ContactSensorState)
|
|
70
|
+
.onGet(() => this.getSensorStatus(accessory.context));
|
|
71
|
+
break;
|
|
72
|
+
case 'fire':
|
|
73
|
+
this.#services.Primary.getCharacteristic(this.#characteristic.SmokeDetected)
|
|
74
|
+
.onGet(() => this.getSensorStatus(accessory.context));
|
|
75
|
+
break;
|
|
76
|
+
case 'flood':
|
|
77
|
+
this.#services.Primary.getCharacteristic(this.#characteristic.LeakDetected)
|
|
78
|
+
.onGet(() => this.getSensorStatus(accessory.context));
|
|
79
|
+
break;
|
|
80
|
+
case 'gateway':
|
|
81
|
+
break;
|
|
82
|
+
case 'glass':
|
|
83
|
+
this.#services.Primary.getCharacteristic(this.#characteristic.MotionDetected)
|
|
84
|
+
.onGet(() => this.getSensorStatus(accessory.context));
|
|
85
|
+
break;
|
|
86
|
+
case 'motion':
|
|
87
|
+
this.#services.Primary.getCharacteristic(this.#characteristic.MotionDetected)
|
|
88
|
+
.onGet(() => this.getSensorStatus(accessory.context));
|
|
89
|
+
break;
|
|
90
|
+
case 'panel':
|
|
91
|
+
this.#services.Primary.getCharacteristic(this.#characteristic.SecuritySystemCurrentState)
|
|
92
|
+
.onGet(() => this.getPanelStatus('current', accessory.context));
|
|
93
|
+
this.#services.Primary.getCharacteristic(this.#characteristic.SecuritySystemTargetState)
|
|
94
|
+
.onGet(() => this.getPanelStatus('target', accessory.context))
|
|
95
|
+
.onSet((value) => this.setPanelStatus(value, accessory.context));
|
|
96
|
+
break;
|
|
97
|
+
case 'temperature':
|
|
98
|
+
this.#services.Primary.getCharacteristic(this.#characteristic.CurrentTemperature)
|
|
99
|
+
.onGet(() => this.getSensorStatus(accessory.context));
|
|
100
|
+
break;
|
|
101
|
+
default:
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
getSensorStatus(context) {
|
|
106
|
+
const { name, type, zone } = context;
|
|
107
|
+
const sensor = this.#state.data.sensorsStatus.find((sensorStatus) => zone !== null && sensorStatus.name === name && sensorStatus.zone === zone);
|
|
108
|
+
if (sensor === undefined || !['co', 'doorWindow', 'fire', 'flood', 'glass', 'motion', 'temperature'].includes(type)) {
|
|
109
|
+
throw new this.#api.hap.HapStatusError(-70409);
|
|
110
|
+
}
|
|
111
|
+
const { status } = sensor;
|
|
112
|
+
if (status === 'Unknown') {
|
|
113
|
+
throw new this.#api.hap.HapStatusError(-70402);
|
|
114
|
+
}
|
|
115
|
+
switch (context.type) {
|
|
116
|
+
case 'co':
|
|
117
|
+
return this.#characteristic.CarbonMonoxideDetected.CO_LEVELS_NORMAL;
|
|
118
|
+
case 'doorWindow':
|
|
119
|
+
if (status.includes('Open')) {
|
|
120
|
+
return this.#characteristic.ContactSensorState.CONTACT_NOT_DETECTED;
|
|
121
|
+
}
|
|
122
|
+
if (status.includes('Closed')) {
|
|
123
|
+
return this.#characteristic.ContactSensorState.CONTACT_DETECTED;
|
|
124
|
+
}
|
|
125
|
+
break;
|
|
126
|
+
case 'fire':
|
|
127
|
+
return this.#characteristic.SmokeDetected.SMOKE_NOT_DETECTED;
|
|
128
|
+
case 'flood':
|
|
129
|
+
if (status.includes('ALARM')) {
|
|
130
|
+
return this.#characteristic.LeakDetected.LEAK_DETECTED;
|
|
131
|
+
}
|
|
132
|
+
if (status.includes('Okay')) {
|
|
133
|
+
return this.#characteristic.LeakDetected.LEAK_NOT_DETECTED;
|
|
134
|
+
}
|
|
135
|
+
break;
|
|
136
|
+
case 'glass':
|
|
137
|
+
if (status.includes('Okay')) {
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
if (status.includes('Tripped')) {
|
|
141
|
+
return true;
|
|
142
|
+
}
|
|
143
|
+
break;
|
|
144
|
+
case 'motion':
|
|
145
|
+
if (status.includes('No Motion')) {
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
if (status.includes('Motion')) {
|
|
149
|
+
return true;
|
|
150
|
+
}
|
|
151
|
+
break;
|
|
152
|
+
case 'temperature':
|
|
153
|
+
return 75;
|
|
154
|
+
default:
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
throw new this.#api.hap.HapStatusError(-70409);
|
|
158
|
+
}
|
|
159
|
+
getPanelStatus(mode, context) {
|
|
160
|
+
if (context.type !== 'panel') {
|
|
161
|
+
throw new this.#api.hap.HapStatusError(-70409);
|
|
162
|
+
}
|
|
163
|
+
if (this.#state.data.panelStatus === null
|
|
164
|
+
|| this.#state.data.panelStatus.state === null
|
|
165
|
+
|| this.#state.data.panelStatus.status === null) {
|
|
166
|
+
throw new this.#api.hap.HapStatusError(-70402);
|
|
167
|
+
}
|
|
168
|
+
const { state, status } = this.#state.data.panelStatus;
|
|
169
|
+
if (state === 'Status Unavailable') {
|
|
170
|
+
throw new this.#api.hap.HapStatusError(-70402);
|
|
171
|
+
}
|
|
172
|
+
if (mode === 'current' && status === 'BURGLARY ALARM') {
|
|
173
|
+
return this.#characteristic.SecuritySystemCurrentState.ALARM_TRIGGERED;
|
|
174
|
+
}
|
|
175
|
+
switch (state) {
|
|
176
|
+
case 'Armed Away':
|
|
177
|
+
return (mode === 'current') ? this.#characteristic.SecuritySystemCurrentState.AWAY_ARM : this.#characteristic.SecuritySystemTargetState.AWAY_ARM;
|
|
178
|
+
case 'Armed Stay':
|
|
179
|
+
return (mode === 'current') ? this.#characteristic.SecuritySystemCurrentState.STAY_ARM : this.#characteristic.SecuritySystemTargetState.STAY_ARM;
|
|
180
|
+
case 'Armed Night':
|
|
181
|
+
return (mode === 'current') ? this.#characteristic.SecuritySystemCurrentState.NIGHT_ARM : this.#characteristic.SecuritySystemTargetState.NIGHT_ARM;
|
|
182
|
+
case 'Disarmed':
|
|
183
|
+
return (mode === 'current') ? this.#characteristic.SecuritySystemCurrentState.DISARMED : this.#characteristic.SecuritySystemTargetState.DISARM;
|
|
184
|
+
default:
|
|
185
|
+
break;
|
|
186
|
+
}
|
|
187
|
+
throw new this.#api.hap.HapStatusError(-70402);
|
|
188
|
+
}
|
|
189
|
+
async setPanelStatus(arm, context) {
|
|
190
|
+
let result;
|
|
191
|
+
if (context.type !== 'panel') {
|
|
192
|
+
throw new this.#api.hap.HapStatusError(-70409);
|
|
193
|
+
}
|
|
194
|
+
switch (arm) {
|
|
195
|
+
case this.#characteristic.SecuritySystemTargetState.STAY_ARM:
|
|
196
|
+
result = await this.#instance.setPanelStatus('stay');
|
|
197
|
+
break;
|
|
198
|
+
case this.#characteristic.SecuritySystemTargetState.AWAY_ARM:
|
|
199
|
+
result = await this.#instance.setPanelStatus('away');
|
|
200
|
+
break;
|
|
201
|
+
case this.#characteristic.SecuritySystemTargetState.NIGHT_ARM:
|
|
202
|
+
result = await this.#instance.setPanelStatus('night');
|
|
203
|
+
break;
|
|
204
|
+
case this.#characteristic.SecuritySystemTargetState.DISARM:
|
|
205
|
+
result = await this.#instance.setPanelStatus('off');
|
|
206
|
+
break;
|
|
207
|
+
default:
|
|
208
|
+
break;
|
|
209
|
+
}
|
|
210
|
+
if (result && result.success) {
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
throw new this.#api.hap.HapStatusError(-70410);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
//# sourceMappingURL=accessory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accessory.js","sourceRoot":"","sources":["../../../src/lib/accessory.ts"],"names":[],"mappings":"AA8BA,MAAM,OAAO,iBAAiB;IAQ5B,UAAU,CAA6B;IASvC,IAAI,CAAuB;IAS3B,eAAe,CAAkC;IASjD,SAAS,CAA4B;IASrC,IAAI,CAAuB;IAS3B,SAAS,CAA4B;IAS5B,MAAM,CAAyB;IAexC,YAAY,SAAgD,EAAE,KAAwC,EAAE,QAA8C,EAAE,OAA4C,EAAE,cAA0D,EAAE,GAAoC,EAAE,GAAoC;QAC1U,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;QACtC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,IAAI,CAAC,SAAS,GAAG,EAAE,C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