@switchbot/homebridge-switchbot 1.7.1-beta.12 → 1.7.1-beta.13
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/dist/devices/bots.d.ts +1 -1
- package/dist/devices/bots.d.ts.map +1 -1
- package/dist/devices/bots.js +27 -24
- package/dist/devices/bots.js.map +1 -1
- package/dist/devices/colorbulb.d.ts.map +1 -1
- package/dist/devices/colorbulb.js +13 -10
- package/dist/devices/colorbulb.js.map +1 -1
- package/dist/devices/contact.d.ts +3 -3
- package/dist/devices/contact.d.ts.map +1 -1
- package/dist/devices/contact.js +38 -32
- package/dist/devices/contact.js.map +1 -1
- package/dist/devices/curtains.d.ts.map +1 -1
- package/dist/devices/curtains.js +13 -10
- package/dist/devices/curtains.js.map +1 -1
- package/dist/devices/humidifiers.d.ts.map +1 -1
- package/dist/devices/humidifiers.js +13 -10
- package/dist/devices/humidifiers.js.map +1 -1
- package/dist/devices/meters.d.ts +3 -3
- package/dist/devices/meters.d.ts.map +1 -1
- package/dist/devices/meters.js +42 -36
- package/dist/devices/meters.js.map +1 -1
- package/dist/devices/motion.d.ts +3 -3
- package/dist/devices/motion.d.ts.map +1 -1
- package/dist/devices/motion.js +38 -32
- package/dist/devices/motion.js.map +1 -1
- package/dist/devices/plugs.d.ts +3 -3
- package/dist/devices/plugs.d.ts.map +1 -1
- package/dist/devices/plugs.js +38 -32
- package/dist/devices/plugs.js.map +1 -1
- package/dist/irdevices/airconditioners.d.ts +1 -1
- package/dist/irdevices/airconditioners.d.ts.map +1 -1
- package/dist/irdevices/airconditioners.js +15 -14
- package/dist/irdevices/airconditioners.js.map +1 -1
- package/dist/irdevices/airpurifiers.d.ts +3 -3
- package/dist/irdevices/airpurifiers.d.ts.map +1 -1
- package/dist/irdevices/airpurifiers.js +19 -18
- package/dist/irdevices/airpurifiers.js.map +1 -1
- package/dist/irdevices/cameras.d.ts +1 -1
- package/dist/irdevices/cameras.d.ts.map +1 -1
- package/dist/irdevices/cameras.js +15 -14
- package/dist/irdevices/cameras.js.map +1 -1
- package/dist/irdevices/fans.d.ts +1 -1
- package/dist/irdevices/fans.d.ts.map +1 -1
- package/dist/irdevices/fans.js +15 -14
- package/dist/irdevices/fans.js.map +1 -1
- package/dist/irdevices/lights.d.ts +1 -1
- package/dist/irdevices/lights.d.ts.map +1 -1
- package/dist/irdevices/lights.js +15 -14
- package/dist/irdevices/lights.js.map +1 -1
- package/dist/irdevices/others.d.ts +2 -2
- package/dist/irdevices/others.d.ts.map +1 -1
- package/dist/irdevices/others.js +19 -18
- package/dist/irdevices/others.js.map +1 -1
- package/dist/irdevices/tvs.d.ts +1 -1
- package/dist/irdevices/tvs.d.ts.map +1 -1
- package/dist/irdevices/tvs.js +15 -14
- package/dist/irdevices/tvs.js.map +1 -1
- package/dist/irdevices/vacuumcleaners.d.ts +1 -1
- package/dist/irdevices/vacuumcleaners.d.ts.map +1 -1
- package/dist/irdevices/vacuumcleaners.js +15 -14
- package/dist/irdevices/vacuumcleaners.js.map +1 -1
- package/dist/irdevices/waterheaters.d.ts +1 -1
- package/dist/irdevices/waterheaters.d.ts.map +1 -1
- package/dist/irdevices/waterheaters.js +15 -14
- package/dist/irdevices/waterheaters.js.map +1 -1
- package/dist/settings.d.ts +6 -6
- package/dist/settings.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/devices/bots.ts +27 -24
- package/src/devices/colorbulb.ts +13 -10
- package/src/devices/contact.ts +38 -32
- package/src/devices/curtains.ts +13 -10
- package/src/devices/humidifiers.ts +13 -10
- package/src/devices/meters.ts +42 -36
- package/src/devices/motion.ts +38 -32
- package/src/devices/plugs.ts +38 -32
- package/src/irdevices/airconditioners.ts +15 -14
- package/src/irdevices/airpurifiers.ts +19 -18
- package/src/irdevices/cameras.ts +15 -14
- package/src/irdevices/fans.ts +15 -14
- package/src/irdevices/lights.ts +15 -14
- package/src/irdevices/others.ts +19 -18
- package/src/irdevices/tvs.ts +15 -14
- package/src/irdevices/vacuumcleaners.ts +15 -14
- package/src/irdevices/waterheaters.ts +15 -14
- package/src/settings.ts +6 -6
package/dist/settings.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ export interface devicesConfig extends device {
|
|
|
42
42
|
contact?: contact;
|
|
43
43
|
motion?: motion;
|
|
44
44
|
colorbulb?: colorbulb;
|
|
45
|
-
plug?:
|
|
45
|
+
plug?: Record<any, any>;
|
|
46
46
|
ble?: string;
|
|
47
47
|
scanDuration?: number;
|
|
48
48
|
hide_device?: boolean;
|
|
@@ -92,11 +92,11 @@ export interface irDevicesConfig extends irdevice {
|
|
|
92
92
|
logging?: string;
|
|
93
93
|
irfan?: irfan;
|
|
94
94
|
irair?: irair;
|
|
95
|
-
irpur?:
|
|
96
|
-
ircam?:
|
|
97
|
-
irlight?:
|
|
98
|
-
irvc?:
|
|
99
|
-
irwh?:
|
|
95
|
+
irpur?: Record<any, any>;
|
|
96
|
+
ircam?: Record<any, any>;
|
|
97
|
+
irlight?: Record<any, any>;
|
|
98
|
+
irvc?: Record<any, any>;
|
|
99
|
+
irwh?: Record<any, any>;
|
|
100
100
|
irtv?: irtv;
|
|
101
101
|
other?: other;
|
|
102
102
|
hide_device?: boolean;
|
package/dist/settings.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACxD;;GAEG;AACH,eAAO,MAAM,aAAa,cAAc,CAAC;AAEzC;;GAEG;AACH,eAAO,MAAM,WAAW,oCAAoC,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,OAAO,+BAA+B,CAAC;AAEpD;;GAEG;AACH,eAAO,MAAM,SAAS,4CAA4C,CAAC;AAGnE,MAAM,WAAW,uBAAwB,SAAQ,cAAc;IAC7D,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,OAAO,CAAC,EAAE,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,CAAC,KAAA,OA8DtB;AAED,wBAAgB,IAAI,CAAC,CAAC,KAAA,YA4ZrB"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "Homebridge SwitchBot",
|
|
3
3
|
"name": "@switchbot/homebridge-switchbot",
|
|
4
|
-
"version": "1.7.1-beta.
|
|
4
|
+
"version": "1.7.1-beta.13",
|
|
5
5
|
"description": "The [Homebridge](https://homebridge.io) SwitchBot plugin allows you to access your [SwitchBot](https://www.switch-bot.com) device(s) from HomeKit.",
|
|
6
6
|
"author": "SwitchBot <support@wondertechlabs.com> (https://github.com/SwitchBot)",
|
|
7
7
|
"license": "ISC",
|
package/src/devices/bots.ts
CHANGED
|
@@ -463,32 +463,21 @@ export class Bot {
|
|
|
463
463
|
accessory.removeService(this.switchService!);
|
|
464
464
|
}
|
|
465
465
|
|
|
466
|
-
scan(device: device & devicesConfig) {
|
|
467
|
-
if (device.scanDuration) {
|
|
468
|
-
this.scanDuration = this.accessory.context.scanDuration = device.scanDuration;
|
|
469
|
-
if (device.ble) {
|
|
470
|
-
this.debugLog(`Bot: ${this.accessory.displayName} Using Device Config scanDuration: ${this.scanDuration}`);
|
|
471
|
-
}
|
|
472
|
-
} else {
|
|
473
|
-
this.scanDuration = this.accessory.context.scanDuration = 1;
|
|
474
|
-
if (this.device.ble) {
|
|
475
|
-
this.debugLog(`Bot: ${this.accessory.displayName} Using Default scanDuration: ${this.scanDuration}`);
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
|
|
480
466
|
config(device: device & devicesConfig) {
|
|
481
467
|
const config: any = device.bot;
|
|
482
|
-
if (device.
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
468
|
+
if (device.ble !== undefined) {
|
|
469
|
+
config['ble'] = device.ble;
|
|
470
|
+
}
|
|
471
|
+
if (device.logging !== undefined) {
|
|
472
|
+
config['logging'] = device.logging;
|
|
473
|
+
}
|
|
474
|
+
if (device.refreshRate !== undefined) {
|
|
475
|
+
config['refreshRate'] = device.refreshRate;
|
|
476
|
+
}
|
|
477
|
+
if (device.scanDuration !== undefined) {
|
|
478
|
+
config['scanDuration'] = device.scanDuration;
|
|
479
|
+
}
|
|
480
|
+
if (config !== undefined) {
|
|
492
481
|
this.warnLog(`Bot: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
|
|
493
482
|
}
|
|
494
483
|
}
|
|
@@ -503,6 +492,20 @@ export class Bot {
|
|
|
503
492
|
}
|
|
504
493
|
}
|
|
505
494
|
|
|
495
|
+
scan(device: device & devicesConfig) {
|
|
496
|
+
if (device.scanDuration) {
|
|
497
|
+
this.scanDuration = this.accessory.context.scanDuration = device.scanDuration;
|
|
498
|
+
if (device.ble) {
|
|
499
|
+
this.debugLog(`Bot: ${this.accessory.displayName} Using Device Config scanDuration: ${this.scanDuration}`);
|
|
500
|
+
}
|
|
501
|
+
} else {
|
|
502
|
+
this.scanDuration = this.accessory.context.scanDuration = 1;
|
|
503
|
+
if (this.device.ble) {
|
|
504
|
+
this.debugLog(`Bot: ${this.accessory.displayName} Using Default scanDuration: ${this.scanDuration}`);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
|
|
506
509
|
logs(device: device & devicesConfig) {
|
|
507
510
|
if (this.platform.debugMode) {
|
|
508
511
|
this.deviceLogging = this.accessory.context.logging = 'debugMode';
|
package/src/devices/colorbulb.ts
CHANGED
|
@@ -216,16 +216,19 @@ export class ColorBulb {
|
|
|
216
216
|
|
|
217
217
|
config(device: device & devicesConfig) {
|
|
218
218
|
const config: any = device.colorbulb;
|
|
219
|
-
if (device.
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
219
|
+
if (device.ble !== undefined) {
|
|
220
|
+
config['ble'] = device.ble;
|
|
221
|
+
}
|
|
222
|
+
if (device.logging !== undefined) {
|
|
223
|
+
config['logging'] = device.logging;
|
|
224
|
+
}
|
|
225
|
+
if (device.refreshRate !== undefined) {
|
|
226
|
+
config['refreshRate'] = device.refreshRate;
|
|
227
|
+
}
|
|
228
|
+
if (device.scanDuration !== undefined) {
|
|
229
|
+
config['scanDuration'] = device.scanDuration;
|
|
230
|
+
}
|
|
231
|
+
if (config !== undefined) {
|
|
229
232
|
this.warnLog(`Color Bulb: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
|
|
230
233
|
}
|
|
231
234
|
}
|
package/src/devices/contact.ts
CHANGED
|
@@ -56,9 +56,9 @@ export class Contact {
|
|
|
56
56
|
public device: device & devicesConfig,
|
|
57
57
|
) {
|
|
58
58
|
// default placeholders
|
|
59
|
-
this.logs();
|
|
60
|
-
this.scan();
|
|
61
|
-
this.refreshRate();
|
|
59
|
+
this.logs(device);
|
|
60
|
+
this.scan(device);
|
|
61
|
+
this.refreshRate(device);
|
|
62
62
|
this.config(device);
|
|
63
63
|
this.ContactSensorState = this.platform.Characteristic.ContactSensorState.CONTACT_DETECTED;
|
|
64
64
|
|
|
@@ -156,55 +156,61 @@ export class Contact {
|
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
config(device: device & devicesConfig) {
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
const config: any = device.contact;
|
|
160
|
+
if (device.ble !== undefined) {
|
|
161
|
+
config['ble'] = device.ble;
|
|
162
|
+
}
|
|
163
|
+
if (device.logging !== undefined) {
|
|
164
|
+
config['logging'] = device.logging;
|
|
165
|
+
}
|
|
166
|
+
if (device.refreshRate !== undefined) {
|
|
167
|
+
config['refreshRate'] = device.refreshRate;
|
|
168
|
+
}
|
|
169
|
+
if (device.scanDuration !== undefined) {
|
|
170
|
+
config['scanDuration'] = device.scanDuration;
|
|
171
|
+
}
|
|
172
|
+
if (config !== undefined) {
|
|
173
|
+
this.warnLog(`Contact Sensor: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
|
|
161
174
|
}
|
|
162
175
|
}
|
|
163
176
|
|
|
164
|
-
refreshRate() {
|
|
165
|
-
if (
|
|
166
|
-
this.deviceRefreshRate = this.accessory.context.refreshRate =
|
|
167
|
-
|
|
168
|
-
this.warnLog(`Contact Sensor: ${this.accessory.displayName} Using Device Config refreshRate: ${this.deviceRefreshRate}`);
|
|
169
|
-
}
|
|
177
|
+
refreshRate(device: device & devicesConfig) {
|
|
178
|
+
if (device.refreshRate) {
|
|
179
|
+
this.deviceRefreshRate = this.accessory.context.refreshRate = device.refreshRate;
|
|
180
|
+
this.debugLog(`Contact Sensor: ${this.accessory.displayName} Using Device Config refreshRate: ${this.deviceRefreshRate}`);
|
|
170
181
|
} else if (this.platform.config.options!.refreshRate) {
|
|
171
182
|
this.deviceRefreshRate = this.accessory.context.refreshRate = this.platform.config.options!.refreshRate;
|
|
172
|
-
|
|
173
|
-
this.warnLog(`Contact Sensor: ${this.accessory.displayName} Using Platform Config refreshRate: ${this.deviceRefreshRate}`);
|
|
174
|
-
}
|
|
183
|
+
this.debugLog(`Contact Sensor: ${this.accessory.displayName} Using Platform Config refreshRate: ${this.deviceRefreshRate}`);
|
|
175
184
|
}
|
|
176
185
|
}
|
|
177
186
|
|
|
178
|
-
scan() {
|
|
179
|
-
if (
|
|
180
|
-
this.scanDuration = this.accessory.context.scanDuration =
|
|
181
|
-
if (
|
|
182
|
-
this.
|
|
187
|
+
scan(device: device & devicesConfig) {
|
|
188
|
+
if (device.scanDuration) {
|
|
189
|
+
this.scanDuration = this.accessory.context.scanDuration = device.scanDuration;
|
|
190
|
+
if (device.ble) {
|
|
191
|
+
this.debugLog(`Contact Sensor: ${this.accessory.displayName} Using Device Config scanDuration: ${this.scanDuration}`);
|
|
183
192
|
}
|
|
184
193
|
} else {
|
|
185
194
|
this.scanDuration = this.accessory.context.scanDuration = 1;
|
|
186
|
-
if (this.
|
|
187
|
-
this.
|
|
195
|
+
if (this.device.ble) {
|
|
196
|
+
this.debugLog(`Contact Sensor: ${this.accessory.displayName} Using Default scanDuration: ${this.scanDuration}`);
|
|
188
197
|
}
|
|
189
198
|
}
|
|
190
199
|
}
|
|
191
200
|
|
|
192
|
-
logs() {
|
|
201
|
+
logs(device: device & devicesConfig) {
|
|
193
202
|
if (this.platform.debugMode) {
|
|
194
|
-
this.deviceLogging = this.accessory.context.logging = '
|
|
195
|
-
this.
|
|
196
|
-
} else if (
|
|
197
|
-
this.deviceLogging = this.accessory.context.logging =
|
|
198
|
-
|
|
199
|
-
this.warnLog(`Contact Sensor: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
200
|
-
}
|
|
203
|
+
this.deviceLogging = this.accessory.context.logging = 'debugMode';
|
|
204
|
+
this.debugLog(`Contact Sensor: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
|
|
205
|
+
} else if (device.logging) {
|
|
206
|
+
this.deviceLogging = this.accessory.context.logging = device.logging;
|
|
207
|
+
this.debugLog(`Contact Sensor: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
201
208
|
} else if (this.platform.config.options?.logging) {
|
|
202
209
|
this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
|
|
203
|
-
|
|
204
|
-
this.warnLog(`Contact Sensor: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
205
|
-
}
|
|
210
|
+
this.debugLog(`Contact Sensor: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
206
211
|
} else {
|
|
207
212
|
this.deviceLogging = this.accessory.context.logging = 'standard';
|
|
213
|
+
this.debugLog(`Contact Sensor: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
|
|
208
214
|
}
|
|
209
215
|
}
|
|
210
216
|
|
package/src/devices/curtains.ts
CHANGED
|
@@ -211,16 +211,19 @@ export class Curtain {
|
|
|
211
211
|
|
|
212
212
|
config(device: device & devicesConfig) {
|
|
213
213
|
const config: any = device.curtain;
|
|
214
|
-
if (device.
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
214
|
+
if (device.ble !== undefined) {
|
|
215
|
+
config['ble'] = device.ble;
|
|
216
|
+
}
|
|
217
|
+
if (device.logging !== undefined) {
|
|
218
|
+
config['logging'] = device.logging;
|
|
219
|
+
}
|
|
220
|
+
if (device.refreshRate !== undefined) {
|
|
221
|
+
config['refreshRate'] = device.refreshRate;
|
|
222
|
+
}
|
|
223
|
+
if (device.scanDuration !== undefined) {
|
|
224
|
+
config['scanDuration'] = device.scanDuration;
|
|
225
|
+
}
|
|
226
|
+
if (config !== undefined) {
|
|
224
227
|
this.warnLog(`Curtain: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
|
|
225
228
|
}
|
|
226
229
|
}
|
|
@@ -200,16 +200,19 @@ export class Humidifier {
|
|
|
200
200
|
|
|
201
201
|
config(device: device & devicesConfig) {
|
|
202
202
|
const config: any = device.humidifier;
|
|
203
|
-
if (device.
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
203
|
+
if (device.ble !== undefined) {
|
|
204
|
+
config['ble'] = device.ble;
|
|
205
|
+
}
|
|
206
|
+
if (device.logging !== undefined) {
|
|
207
|
+
config['logging'] = device.logging;
|
|
208
|
+
}
|
|
209
|
+
if (device.refreshRate !== undefined) {
|
|
210
|
+
config['refreshRate'] = device.refreshRate;
|
|
211
|
+
}
|
|
212
|
+
if (device.scanDuration !== undefined) {
|
|
213
|
+
config['scanDuration'] = device.scanDuration;
|
|
214
|
+
}
|
|
215
|
+
if (config !== undefined) {
|
|
213
216
|
this.warnLog(`Humidifier: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
|
|
214
217
|
}
|
|
215
218
|
}
|
package/src/devices/meters.ts
CHANGED
|
@@ -55,9 +55,9 @@ export class Meter {
|
|
|
55
55
|
public device: device & devicesConfig,
|
|
56
56
|
) {
|
|
57
57
|
// default placeholders
|
|
58
|
-
this.logs();
|
|
59
|
-
this.scan();
|
|
60
|
-
this.refreshRate();
|
|
58
|
+
this.logs(device);
|
|
59
|
+
this.scan(device);
|
|
60
|
+
this.refreshRate(device);
|
|
61
61
|
this.config(device);
|
|
62
62
|
if (this.CurrentRelativeHumidity === undefined) {
|
|
63
63
|
this.CurrentRelativeHumidity = 0;
|
|
@@ -175,55 +175,61 @@ export class Meter {
|
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
config(device: device & devicesConfig) {
|
|
178
|
-
|
|
179
|
-
|
|
178
|
+
const config: any = device.meter;
|
|
179
|
+
if (device.ble !== undefined) {
|
|
180
|
+
config['ble'] = device.ble;
|
|
181
|
+
}
|
|
182
|
+
if (device.logging !== undefined) {
|
|
183
|
+
config['logging'] = device.logging;
|
|
184
|
+
}
|
|
185
|
+
if (device.refreshRate !== undefined) {
|
|
186
|
+
config['refreshRate'] = device.refreshRate;
|
|
187
|
+
}
|
|
188
|
+
if (device.scanDuration !== undefined) {
|
|
189
|
+
config['scanDuration'] = device.scanDuration;
|
|
190
|
+
}
|
|
191
|
+
if (config !== undefined) {
|
|
192
|
+
this.warnLog(`Meter: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
|
|
180
193
|
}
|
|
181
194
|
}
|
|
182
195
|
|
|
183
|
-
refreshRate() {
|
|
184
|
-
if (
|
|
185
|
-
this.deviceRefreshRate = this.accessory.context.refreshRate =
|
|
186
|
-
|
|
187
|
-
this.warnLog(`Meter: ${this.accessory.displayName} Using Device Config refreshRate: ${this.deviceRefreshRate}`);
|
|
188
|
-
}
|
|
196
|
+
refreshRate(device: device & devicesConfig) {
|
|
197
|
+
if (device.refreshRate) {
|
|
198
|
+
this.deviceRefreshRate = this.accessory.context.refreshRate = device.refreshRate;
|
|
199
|
+
this.debugLog(`Meter: ${this.accessory.displayName} Using Device Config refreshRate: ${this.deviceRefreshRate}`);
|
|
189
200
|
} else if (this.platform.config.options!.refreshRate) {
|
|
190
201
|
this.deviceRefreshRate = this.accessory.context.refreshRate = this.platform.config.options!.refreshRate;
|
|
191
|
-
|
|
192
|
-
this.warnLog(`Meter: ${this.accessory.displayName} Using Platform Config refreshRate: ${this.deviceRefreshRate}`);
|
|
193
|
-
}
|
|
202
|
+
this.debugLog(`Meter: ${this.accessory.displayName} Using Platform Config refreshRate: ${this.deviceRefreshRate}`);
|
|
194
203
|
}
|
|
195
204
|
}
|
|
196
205
|
|
|
197
|
-
scan() {
|
|
198
|
-
if (
|
|
199
|
-
this.scanDuration = this.accessory.context.scanDuration =
|
|
200
|
-
if (
|
|
201
|
-
this.
|
|
206
|
+
scan(device: device & devicesConfig) {
|
|
207
|
+
if (device.scanDuration) {
|
|
208
|
+
this.scanDuration = this.accessory.context.scanDuration = device.scanDuration;
|
|
209
|
+
if (device.ble) {
|
|
210
|
+
this.debugLog(`Meter: ${this.accessory.displayName} Using Device Config scanDuration: ${this.scanDuration}`);
|
|
202
211
|
}
|
|
203
212
|
} else {
|
|
204
213
|
this.scanDuration = this.accessory.context.scanDuration = 1;
|
|
205
|
-
if (this.
|
|
206
|
-
this.
|
|
214
|
+
if (this.device.ble) {
|
|
215
|
+
this.debugLog(`Meter: ${this.accessory.displayName} Using Default scanDuration: ${this.scanDuration}`);
|
|
207
216
|
}
|
|
208
217
|
}
|
|
209
218
|
}
|
|
210
219
|
|
|
211
|
-
logs() {
|
|
220
|
+
logs(device: device & devicesConfig) {
|
|
212
221
|
if (this.platform.debugMode) {
|
|
213
|
-
this.deviceLogging = this.accessory.context.logging = '
|
|
214
|
-
this.
|
|
215
|
-
} else if (
|
|
216
|
-
this.deviceLogging = this.accessory.context.logging =
|
|
217
|
-
|
|
218
|
-
this.warnLog(`Meter: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
219
|
-
}
|
|
222
|
+
this.deviceLogging = this.accessory.context.logging = 'debugMode';
|
|
223
|
+
this.debugLog(`Meter: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
|
|
224
|
+
} else if (device.logging) {
|
|
225
|
+
this.deviceLogging = this.accessory.context.logging = device.logging;
|
|
226
|
+
this.debugLog(`Meter: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
220
227
|
} else if (this.platform.config.options?.logging) {
|
|
221
228
|
this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
|
|
222
|
-
|
|
223
|
-
this.warnLog(`Meter: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
224
|
-
}
|
|
229
|
+
this.debugLog(`Meter: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
225
230
|
} else {
|
|
226
231
|
this.deviceLogging = this.accessory.context.logging = 'standard';
|
|
232
|
+
this.debugLog(`Meter: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
|
|
227
233
|
}
|
|
228
234
|
}
|
|
229
235
|
|
|
@@ -415,16 +421,16 @@ export class Meter {
|
|
|
415
421
|
}
|
|
416
422
|
if (this.device.ble) {
|
|
417
423
|
if (this.BatteryLevel === undefined) {
|
|
418
|
-
this.debugLog(`
|
|
424
|
+
this.debugLog(`Meter: ${this.accessory.displayName} BatteryLevel: ${this.BatteryLevel}`);
|
|
419
425
|
} else {
|
|
420
426
|
this.batteryService?.updateCharacteristic(this.platform.Characteristic.BatteryLevel, this.BatteryLevel);
|
|
421
|
-
this.debugLog(`
|
|
427
|
+
this.debugLog(`Meter: ${this.accessory.displayName} updateCharacteristic BatteryLevel: ${this.BatteryLevel}`);
|
|
422
428
|
}
|
|
423
429
|
if (this.StatusLowBattery === undefined) {
|
|
424
|
-
this.debugLog(`
|
|
430
|
+
this.debugLog(`Meter: ${this.accessory.displayName} StatusLowBattery: ${this.StatusLowBattery}`);
|
|
425
431
|
} else {
|
|
426
432
|
this.batteryService?.updateCharacteristic(this.platform.Characteristic.StatusLowBattery, this.StatusLowBattery);
|
|
427
|
-
this.debugLog(`
|
|
433
|
+
this.debugLog(`Meter: ${this.accessory.displayName} updateCharacteristic StatusLowBattery: ${this.StatusLowBattery}`);
|
|
428
434
|
}
|
|
429
435
|
}
|
|
430
436
|
}
|
package/src/devices/motion.ts
CHANGED
|
@@ -52,9 +52,9 @@ export class Motion {
|
|
|
52
52
|
public device: device & devicesConfig,
|
|
53
53
|
) {
|
|
54
54
|
// default placeholders
|
|
55
|
-
this.logs();
|
|
56
|
-
this.scan();
|
|
57
|
-
this.refreshRate();
|
|
55
|
+
this.logs(device);
|
|
56
|
+
this.scan(device);
|
|
57
|
+
this.refreshRate(device);
|
|
58
58
|
this.config(device);
|
|
59
59
|
this.MotionDetected = false;
|
|
60
60
|
|
|
@@ -140,55 +140,61 @@ export class Motion {
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
config(device: device & devicesConfig) {
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
const config: any = device.motion;
|
|
144
|
+
if (device.ble !== undefined) {
|
|
145
|
+
config['ble'] = device.ble;
|
|
146
|
+
}
|
|
147
|
+
if (device.logging !== undefined) {
|
|
148
|
+
config['logging'] = device.logging;
|
|
149
|
+
}
|
|
150
|
+
if (device.refreshRate !== undefined) {
|
|
151
|
+
config['refreshRate'] = device.refreshRate;
|
|
152
|
+
}
|
|
153
|
+
if (device.scanDuration !== undefined) {
|
|
154
|
+
config['scanDuration'] = device.scanDuration;
|
|
155
|
+
}
|
|
156
|
+
if (config !== undefined) {
|
|
157
|
+
this.warnLog(`Motion Sensor: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
|
|
145
158
|
}
|
|
146
159
|
}
|
|
147
160
|
|
|
148
|
-
refreshRate() {
|
|
149
|
-
if (
|
|
150
|
-
this.deviceRefreshRate = this.accessory.context.refreshRate =
|
|
151
|
-
|
|
152
|
-
this.warnLog(`Motion Sensor: ${this.accessory.displayName} Using Device Config refreshRate: ${this.deviceRefreshRate}`);
|
|
153
|
-
}
|
|
161
|
+
refreshRate(device: device & devicesConfig) {
|
|
162
|
+
if (device.refreshRate) {
|
|
163
|
+
this.deviceRefreshRate = this.accessory.context.refreshRate = device.refreshRate;
|
|
164
|
+
this.debugLog(`Motion Sensor: ${this.accessory.displayName} Using Device Config refreshRate: ${this.deviceRefreshRate}`);
|
|
154
165
|
} else if (this.platform.config.options!.refreshRate) {
|
|
155
166
|
this.deviceRefreshRate = this.accessory.context.refreshRate = this.platform.config.options!.refreshRate;
|
|
156
|
-
|
|
157
|
-
this.warnLog(`Motion Sensor: ${this.accessory.displayName} Using Platform Config refreshRate: ${this.deviceRefreshRate}`);
|
|
158
|
-
}
|
|
167
|
+
this.debugLog(`Motion Sensor: ${this.accessory.displayName} Using Platform Config refreshRate: ${this.deviceRefreshRate}`);
|
|
159
168
|
}
|
|
160
169
|
}
|
|
161
170
|
|
|
162
|
-
scan() {
|
|
163
|
-
if (
|
|
164
|
-
this.scanDuration = this.accessory.context.scanDuration =
|
|
165
|
-
if (
|
|
166
|
-
this.
|
|
171
|
+
scan(device: device & devicesConfig) {
|
|
172
|
+
if (device.scanDuration) {
|
|
173
|
+
this.scanDuration = this.accessory.context.scanDuration = device.scanDuration;
|
|
174
|
+
if (device.ble) {
|
|
175
|
+
this.debugLog(`Motion Sensor: ${this.accessory.displayName} Using Device Config scanDuration: ${this.scanDuration}`);
|
|
167
176
|
}
|
|
168
177
|
} else {
|
|
169
178
|
this.scanDuration = this.accessory.context.scanDuration = 1;
|
|
170
|
-
if (this.
|
|
171
|
-
this.
|
|
179
|
+
if (this.device.ble) {
|
|
180
|
+
this.debugLog(`Motion Sensor: ${this.accessory.displayName} Using Default scanDuration: ${this.scanDuration}`);
|
|
172
181
|
}
|
|
173
182
|
}
|
|
174
183
|
}
|
|
175
184
|
|
|
176
|
-
logs() {
|
|
185
|
+
logs(device: device & devicesConfig) {
|
|
177
186
|
if (this.platform.debugMode) {
|
|
178
|
-
this.deviceLogging = this.accessory.context.logging = '
|
|
179
|
-
this.
|
|
180
|
-
} else if (
|
|
181
|
-
this.deviceLogging = this.accessory.context.logging =
|
|
182
|
-
|
|
183
|
-
this.warnLog(`Motion Sensor: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
184
|
-
}
|
|
187
|
+
this.deviceLogging = this.accessory.context.logging = 'debugMode';
|
|
188
|
+
this.debugLog(`Motion Sensor: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
|
|
189
|
+
} else if (device.logging) {
|
|
190
|
+
this.deviceLogging = this.accessory.context.logging = device.logging;
|
|
191
|
+
this.debugLog(`Motion Sensor: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
185
192
|
} else if (this.platform.config.options?.logging) {
|
|
186
193
|
this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
|
|
187
|
-
|
|
188
|
-
this.warnLog(`Motion Sensor: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
189
|
-
}
|
|
194
|
+
this.debugLog(`Motion Sensor: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
190
195
|
} else {
|
|
191
196
|
this.deviceLogging = this.accessory.context.logging = 'standard';
|
|
197
|
+
this.debugLog(`Motion Sensor: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
|
|
192
198
|
}
|
|
193
199
|
}
|
|
194
200
|
|