homebridge-adt-pulse 2.1.6 → 2.2.0
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 +11 -1
- package/config.schema.json +9 -0
- package/index.js +13 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -40,6 +40,7 @@ When configuring this plugin, simply add the platform to your existing `config.j
|
|
|
40
40
|
"logLevel": 30,
|
|
41
41
|
"logActivity": true,
|
|
42
42
|
"removeObsoleteZones": true,
|
|
43
|
+
"pausePlugin": false,
|
|
43
44
|
"resetAll": false
|
|
44
45
|
},
|
|
45
46
|
{
|
|
@@ -149,6 +150,15 @@ The default is `true`. Configure `removeObsoleteZones` with the values below:
|
|
|
149
150
|
|
|
150
151
|
__NOTE:__ If recently, you had sensors removed from ADT Pulse, the plugin will not remove these sensors unless `removeObsoleteZones` is set to `true`.
|
|
151
152
|
|
|
153
|
+
## Pausing the Plugin
|
|
154
|
+
The plugin may continuously ping the ADT Pulse servers, even when authentication fails, which will cause your IP to be temporarily banned. This will pause the plugin without you breaking other plugins. _Optional._
|
|
155
|
+
|
|
156
|
+
The default is `false`. Configure `pausePlugin` with the values below:
|
|
157
|
+
* Set `pausePlugin` to `true` for reset mode
|
|
158
|
+
* Set `pausePlugin` to `false` for normal mode
|
|
159
|
+
|
|
160
|
+
__NOTE:__ Once you are ready to resume the plugin, remember to set the `pausePlugin` setting back to `false` or else the plugin will continue to stay paused.
|
|
161
|
+
|
|
152
162
|
## Resetting the Plugin
|
|
153
163
|
Managing many accessories in a Homebridge environment is already a seemingly hard task, and sometimes you might want to step back and do a reset. _Optional._
|
|
154
164
|
|
|
@@ -162,7 +172,7 @@ __NOTE:__ Once reset is complete, remember to set the `resetAll` setting back to
|
|
|
162
172
|
The script provides an active connection to the ADT Pulse portal. Here is a list of must-knows, just in case you might want to debug (or improve) the plugin:
|
|
163
173
|
|
|
164
174
|
1. Device and zone statuses will be fetched every __3 seconds__. If logins have failed more than 2 times, portal sync will pause for 10 minutes.
|
|
165
|
-
2. Supported versions are `
|
|
175
|
+
2. Supported versions are `25.0.0-21` and `26.0.0-32`. If this plugin does not support either version, a warning will appear in the logs. Please [submit an issue](https://github.com/mrjackyliang/homebridge-adt-pulse/issues/new/choose) to let me know!
|
|
166
176
|
|
|
167
177
|
## Credits and Appreciation
|
|
168
178
|
If you would like to show your appreciation for its continued development, you can optionally become my supporter on [GitHub Sponsors](https://github.com/sponsors/mrjackyliang)!
|
package/config.schema.json
CHANGED
|
@@ -169,6 +169,12 @@
|
|
|
169
169
|
"default": true,
|
|
170
170
|
"required": false
|
|
171
171
|
},
|
|
172
|
+
"pausePlugin": {
|
|
173
|
+
"title": "Pause Plugin",
|
|
174
|
+
"type": "boolean",
|
|
175
|
+
"default": false,
|
|
176
|
+
"required": false
|
|
177
|
+
},
|
|
172
178
|
"resetAll": {
|
|
173
179
|
"title": "Reset Plugin \uD83D\uDED1",
|
|
174
180
|
"type": "boolean",
|
|
@@ -219,6 +225,9 @@
|
|
|
219
225
|
{
|
|
220
226
|
"key": "removeObsoleteZones"
|
|
221
227
|
},
|
|
228
|
+
{
|
|
229
|
+
"key": "pausePlugin"
|
|
230
|
+
},
|
|
222
231
|
{
|
|
223
232
|
"key": "resetAll"
|
|
224
233
|
}
|
package/index.js
CHANGED
|
@@ -54,6 +54,7 @@ function ADTPulsePlatform(log, config, api) {
|
|
|
54
54
|
this.logLevel = _.get(this.config, 'logLevel');
|
|
55
55
|
this.logActivity = _.get(this.config, 'logActivity');
|
|
56
56
|
this.removeObsoleteZones = _.get(this.config, 'removeObsoleteZones');
|
|
57
|
+
this.pausePlugin = _.get(this.config, 'pausePlugin');
|
|
57
58
|
this.resetAll = _.get(this.config, 'resetAll');
|
|
58
59
|
|
|
59
60
|
// Timers.
|
|
@@ -62,7 +63,7 @@ function ADTPulsePlatform(log, config, api) {
|
|
|
62
63
|
this.setDeviceTimeout = 6; // 6 seconds.
|
|
63
64
|
|
|
64
65
|
// Tested builds.
|
|
65
|
-
this.testedBuilds = ['
|
|
66
|
+
this.testedBuilds = ['25.0.0-21', '26.0.0-32'];
|
|
66
67
|
|
|
67
68
|
// Setup logging function.
|
|
68
69
|
if (typeof this.logLevel !== 'number' || ![10, 20, 30, 40, 50].includes(this.logLevel)) {
|
|
@@ -113,6 +114,14 @@ function ADTPulsePlatform(log, config, api) {
|
|
|
113
114
|
this.removeObsoleteZones = true;
|
|
114
115
|
}
|
|
115
116
|
|
|
117
|
+
// Prevent accidental pausing.
|
|
118
|
+
if (typeof this.pausePlugin !== 'boolean') {
|
|
119
|
+
if (this.pausePlugin !== undefined) {
|
|
120
|
+
this.logMessage('"pausePlugin" setting should be true or false. Defaulting to false.', 20);
|
|
121
|
+
}
|
|
122
|
+
this.pausePlugin = false;
|
|
123
|
+
}
|
|
124
|
+
|
|
116
125
|
// Prevent accidental reset.
|
|
117
126
|
if (typeof this.resetAll !== 'boolean') {
|
|
118
127
|
if (this.resetAll !== undefined) {
|
|
@@ -144,7 +153,9 @@ function ADTPulsePlatform(log, config, api) {
|
|
|
144
153
|
homebridgeVer: _.get(api, 'serverVersion'),
|
|
145
154
|
});
|
|
146
155
|
|
|
147
|
-
if (this.
|
|
156
|
+
if (this.pausePlugin) {
|
|
157
|
+
this.logMessage('ADT Pulse plugin is now paused...', 20);
|
|
158
|
+
} else if (this.resetAll) {
|
|
148
159
|
this.logMessage('Removing all ADT Pulse accessories from Homebridge...', 20);
|
|
149
160
|
|
|
150
161
|
_.forEachRight(this.accessories, (accessory) => {
|