homebridge-adt-pulse 3.0.0-beta.1 → 3.0.0-beta.11

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.
@@ -1,237 +1,326 @@
1
1
  {
2
- "pluginAlias": "ADTPulse",
3
- "pluginType": "platform",
4
- "singular": true,
5
- "headerDisplay": "An account to link your [ADT Pulse](https://portal.adtpulse.com/) system to Homebridge is required. This will be used to control your security panel and read sensor status.",
6
- "footerDisplay": "If you need assistance, you may read the [plugin instructions](https://github.com/mrjackyliang/homebridge-adt-pulse#readme) or feel free to [submit an issue](https://github.com/mrjackyliang/homebridge-adt-pulse/issues/new/choose).",
7
- "schema": {
8
- "type": "object",
9
- "properties": {
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": "Synchronization Speed",
97
+ "type": "number",
98
+ "required": true,
99
+ "description": "Choose the synchronization 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> A maximum of 148 sensors can be added (the plugin reserves 2 accessories for the gateway and security panel).",
133
+ "items": {
134
+ "type": "object",
135
+ "properties": {
10
136
  "name": {
11
- "title": "Name",
12
- "type": "string",
13
- "default": "ADT Pulse",
14
- "required": true,
15
- "description": "Plugin name as displayed in the Homebridge log"
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
16
144
  },
17
- "username": {
18
- "title": "Username",
19
- "type": "string",
20
- "default": "",
21
- "required": true,
22
- "format": "email",
23
- "minLength": 6,
24
- "maxLength": 50,
25
- "description": "Email address used for ADT Pulse login"
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
26
153
  },
27
- "password": {
28
- "title": "Password",
29
- "type": "string",
30
- "default": "",
31
- "required": true,
32
- "minLength": 8,
33
- "maxLength": 50,
34
- "description": "Password used for ADT Pulse login"
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": "Water/Flood Sensor",
180
+ "enum": [
181
+ "flood"
182
+ ]
183
+ },
184
+ {
185
+ "title": "Glass Break Detector",
186
+ "enum": [
187
+ "glass"
188
+ ]
189
+ },
190
+ {
191
+ "title": "Keypad/Touchpad",
192
+ "enum": [
193
+ "keypad"
194
+ ]
195
+ },
196
+ {
197
+ "title": "Motion Sensor :: Motion Sensor (Notable Events Only)",
198
+ "enum": [
199
+ "motion"
200
+ ]
201
+ },
202
+ {
203
+ "title": "Audible Panic Button/Pendant :: Silent Panic Button/Pendant",
204
+ "enum": [
205
+ "panic"
206
+ ]
207
+ },
208
+ {
209
+ "title": "Shock Sensor",
210
+ "enum": [
211
+ "shock"
212
+ ]
213
+ },
214
+ {
215
+ "title": "Temperature Sensor",
216
+ "enum": [
217
+ "temperature"
218
+ ]
219
+ }
220
+ ]
35
221
  },
36
- "fingerprint": {
37
- "title": "MFA Fingerprint",
38
- "type": "string",
39
- "default": "",
40
- "required": true,
41
- "description": "MFA Fingerprint from browser registered with ADT Pulse"
222
+ "adtZone": {
223
+ "title": "ADT Sensor Zone",
224
+ "type": "number",
225
+ "required": true,
226
+ "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.",
227
+ "placeholder": "e.g. 99",
228
+ "minimum": 1,
229
+ "maximum": 999
230
+ }
231
+ }
232
+ },
233
+ "minItems": 0,
234
+ "maxItems": 148
235
+ }
236
+ }
237
+ },
238
+ "layout": [
239
+ {
240
+ "type": "tabs",
241
+ "tabs": [
242
+ {
243
+ "title": "General",
244
+ "htmlClass": "px-3 pt-3 pb-0",
245
+ "items": [
246
+ {
247
+ "key": "name",
248
+ "type": "text"
42
249
  },
43
- "overrideSensors": {
44
- "title": "Override Sensors",
45
- "type": "array",
46
- "items": {
47
- "type": "object",
48
- "properties": {
49
- "name": {
50
- "title": "Name",
51
- "type": "string",
52
- "default": "",
53
- "required": true,
54
- "description": "The sensor name for the sensor you would like to override"
55
- },
56
- "type": {
57
- "title": "Type",
58
- "type": "string",
59
- "default": "",
60
- "oneOf": [
61
- {
62
- "title": "Door/Window Sensor",
63
- "enum": [
64
- "sensor,doorWindow"
65
- ]
66
- },
67
- {
68
- "title": "Glass Break Detector",
69
- "enum": [
70
- "sensor,glass"
71
- ]
72
- },
73
- {
74
- "title": "Motion Sensor",
75
- "enum": [
76
- "sensor,motion"
77
- ]
78
- },
79
- {
80
- "title": "Carbon Monoxide Detector",
81
- "enum": [
82
- "sensor,co"
83
- ]
84
- },
85
- {
86
- "title": "Fire (Smoke/Heat) Detector",
87
- "enum": [
88
- "sensor,fire"
89
- ]
90
- }
91
- ],
92
- "required": true,
93
- "description": "The sensor type for the sensor you would like to override"
94
- }
95
- }
96
- },
97
- "description": "When a sensor cannot be detected accurately, you can manually set the sensor here to override the default detection features"
250
+ {
251
+ "key": "mode",
252
+ "type": "select"
98
253
  },
99
- "country": {
100
- "title": "Country",
101
- "type": "string",
102
- "default": "us",
103
- "oneOf": [
104
- {
105
- "title": "United States",
106
- "enum": [
107
- "us"
108
- ]
109
- },
110
- {
111
- "title": "Canada",
112
- "enum": [
113
- "ca"
114
- ]
115
- }
116
- ],
117
- "required": false,
118
- "description": "Select a country where ADT Pulse will connect to"
254
+ {
255
+ "key": "speed",
256
+ "type": "select"
257
+ }
258
+ ]
259
+ },
260
+ {
261
+ "title": "Login",
262
+ "htmlClass": "px-3 pt-3 pb-0",
263
+ "items": [
264
+ {
265
+ "key": "subdomain",
266
+ "type": "select"
119
267
  },
120
- "logLevel": {
121
- "title": "Log Level",
122
- "type": "integer",
123
- "default": 30,
124
- "oneOf": [
125
- {
126
- "title": "Errors (Level 10)",
127
- "enum": [
128
- 10
129
- ]
130
- },
268
+ {
269
+ "key": "username",
270
+ "type": "text"
271
+ },
272
+ {
273
+ "key": "password",
274
+ "type": "password"
275
+ },
276
+ {
277
+ "key": "fingerprint",
278
+ "type": "password"
279
+ },
280
+ {
281
+ "type": "help",
282
+ "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>"
283
+ }
284
+ ]
285
+ },
286
+ {
287
+ "title": "Devices",
288
+ "htmlClass": "px-3 pt-3 pb-0",
289
+ "items": [
290
+ {
291
+ "key": "sensors",
292
+ "htmlClass": "p-10",
293
+ "buttonText": "Add Sensor",
294
+ "items": [
295
+ {
296
+ "type": "div",
297
+ "htmlClass": "my-3",
298
+ "items": [
131
299
  {
132
- "title": "Warnings (Level 20)",
133
- "enum": [
134
- 20
135
- ]
300
+ "key": "sensors[].name",
301
+ "type": "text"
136
302
  },
137
303
  {
138
- "title": "Info (Level 30)",
139
- "enum": [
140
- 30
141
- ]
304
+ "key": "sensors[].adtName",
305
+ "type": "text"
142
306
  },
143
307
  {
144
- "title": "Debug (Level 40)",
145
- "enum": [
146
- 40
147
- ]
308
+ "key": "sensors[].adtType",
309
+ "type": "select"
148
310
  },
149
311
  {
150
- "title": "Verbose (Level 50)",
151
- "enum": [
152
- 50
153
- ]
312
+ "key": "sensors[].adtZone",
313
+ "type": "number"
154
314
  }
155
- ],
156
- "required": false,
157
- "pattern": "^([1-5])([0])$",
158
- "description": "Higher levels mean more logs will show. Turn on Homebridge Debug Mode for levels 40 and 50. Recommended setting is \"Info (Level 30)\""
159
- },
160
- "logActivity": {
161
- "title": "Log Activity",
162
- "type": "boolean",
163
- "default": true,
164
- "required": false
165
- },
166
- "removeObsoleteZones": {
167
- "title": "Remove Obsolete Zones",
168
- "type": "boolean",
169
- "default": true,
170
- "required": false
171
- },
172
- "pausePlugin": {
173
- "title": "Pause Plugin",
174
- "type": "boolean",
175
- "default": false,
176
- "required": false
177
- },
178
- "resetAll": {
179
- "title": "Reset Plugin \uD83D\uDED1",
180
- "type": "boolean",
181
- "default": false,
182
- "required": false
183
- }
184
- }
185
- },
186
- "layout": [
187
- {
188
- "key": "name"
189
- },
190
- {
191
- "display": "flex",
192
- "flex-flow": "row nowrap",
193
- "justify-content": "space-between",
194
- "items": [
195
- {
196
- "key": "username",
197
- "flex": "1 0 0px"
198
- },
199
- {
200
- "key": "password",
201
- "flex": "1 0 0px"
315
+ ]
202
316
  }
203
- ]
204
- },
205
- {
206
- "key": "fingerprint"
207
- },
208
- {
209
- "key": "overrideSensors",
210
- "buttonText": "Add Sensor",
211
- "items": [
212
- "overrideSensors[].name",
213
- "overrideSensors[].type"
214
- ]
215
- },
216
- {
217
- "key": "country"
218
- },
219
- {
220
- "key": "logLevel"
221
- },
222
- {
223
- "key": "logActivity"
224
- },
225
- {
226
- "key": "removeObsoleteZones"
227
- },
228
- {
229
- "key": "pausePlugin"
230
- },
231
- {
232
- "key": "resetAll"
317
+ ]
318
+ }
319
+ ]
233
320
  }
234
- ],
235
- "form": null,
236
- "display": null
321
+ ]
322
+ }
323
+ ],
324
+ "form": null,
325
+ "display": null
237
326
  }
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "homebridge-adt-pulse",
3
3
  "displayName": "Homebridge ADT Pulse",
4
- "version": "3.0.0-beta.1",
4
+ "version": "3.0.0-beta.11",
5
5
  "description": "Homebridge security system platform for ADT Pulse",
6
+ "main": "./build/src/index.js",
6
7
  "exports": "./build/src/index.js",
7
8
  "type": "module",
8
9
  "private": false,
@@ -13,7 +14,8 @@
13
14
  "build:cleanup": "rimraf build",
14
15
  "build:tsc": "tsc --project tsconfig.json",
15
16
  "build:fix-paths": "tsconfig-replace-paths --project tsconfig.json",
16
- "postinstall": "npm run build",
17
+ "prepare": "npm run build",
18
+ "prepublishOnly": "npm run build",
17
19
  "repl": "node ./build/src/scripts/repl.js",
18
20
  "test-api": "node ./build/src/scripts/test-api.js"
19
21
  },
@@ -41,7 +43,7 @@
41
43
  "url": "https://github.com/mrjackyliang/homebridge-adt-pulse/issues"
42
44
  },
43
45
  "files": [
44
- "./src",
46
+ "./build",
45
47
  "config.schema.json"
46
48
  ],
47
49
  "homepage": "https://github.com/mrjackyliang/homebridge-adt-pulse",
@@ -54,6 +56,7 @@
54
56
  "axios-cookiejar-support": "4.0.7",
55
57
  "chalk": "5.3.0",
56
58
  "jsdom": "23.0.1",
59
+ "latest-version": "7.0.0",
57
60
  "lodash": "4.17.21",
58
61
  "serialize-error": "11.0.3",
59
62
  "tough-cookie": "4.1.3",
@@ -62,14 +65,14 @@
62
65
  "devDependencies": {
63
66
  "@types/jsdom": "21.1.6",
64
67
  "@types/lodash": "4.14.202",
65
- "@types/node": "20.10.4",
68
+ "@types/node": "20.10.5",
66
69
  "@types/tough-cookie": "4.0.5",
67
- "@typescript-eslint/eslint-plugin": "6.13.2",
68
- "@typescript-eslint/parser": "6.13.2",
69
- "eslint": "8.55.0",
70
+ "@typescript-eslint/eslint-plugin": "6.15.0",
71
+ "@typescript-eslint/parser": "6.15.0",
72
+ "eslint": "8.56.0",
70
73
  "eslint-config-airbnb-base": "15.0.0",
71
74
  "eslint-config-airbnb-typescript": "17.1.0",
72
- "eslint-plugin-import": "2.29.0",
75
+ "eslint-plugin-import": "2.29.1",
73
76
  "homebridge": "1.7.0",
74
77
  "npm-run-all": "4.1.5",
75
78
  "rimraf": "5.0.5",
package/src/index.ts DELETED
@@ -1,18 +0,0 @@
1
- import { ADTPulsePlatform } from '@/lib/platform.js';
2
- import type { InitializeApi, InitializeReturns } from '@/types/index.d.ts';
3
-
4
- /**
5
- * Initialize.
6
- *
7
- * @param {InitializeApi} api - Api.
8
- *
9
- * @returns {InitializeReturns}
10
- *
11
- * @since 1.0.0
12
- */
13
- function initialize(api: InitializeApi): InitializeReturns {
14
- api.registerPlatform('ADTPulse', ADTPulsePlatform);
15
- }
16
-
17
- // Tell Homebridge this is the starting point.
18
- export default initialize;