@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.
Files changed (86) hide show
  1. package/dist/devices/bots.d.ts +1 -1
  2. package/dist/devices/bots.d.ts.map +1 -1
  3. package/dist/devices/bots.js +27 -24
  4. package/dist/devices/bots.js.map +1 -1
  5. package/dist/devices/colorbulb.d.ts.map +1 -1
  6. package/dist/devices/colorbulb.js +13 -10
  7. package/dist/devices/colorbulb.js.map +1 -1
  8. package/dist/devices/contact.d.ts +3 -3
  9. package/dist/devices/contact.d.ts.map +1 -1
  10. package/dist/devices/contact.js +38 -32
  11. package/dist/devices/contact.js.map +1 -1
  12. package/dist/devices/curtains.d.ts.map +1 -1
  13. package/dist/devices/curtains.js +13 -10
  14. package/dist/devices/curtains.js.map +1 -1
  15. package/dist/devices/humidifiers.d.ts.map +1 -1
  16. package/dist/devices/humidifiers.js +13 -10
  17. package/dist/devices/humidifiers.js.map +1 -1
  18. package/dist/devices/meters.d.ts +3 -3
  19. package/dist/devices/meters.d.ts.map +1 -1
  20. package/dist/devices/meters.js +42 -36
  21. package/dist/devices/meters.js.map +1 -1
  22. package/dist/devices/motion.d.ts +3 -3
  23. package/dist/devices/motion.d.ts.map +1 -1
  24. package/dist/devices/motion.js +38 -32
  25. package/dist/devices/motion.js.map +1 -1
  26. package/dist/devices/plugs.d.ts +3 -3
  27. package/dist/devices/plugs.d.ts.map +1 -1
  28. package/dist/devices/plugs.js +38 -32
  29. package/dist/devices/plugs.js.map +1 -1
  30. package/dist/irdevices/airconditioners.d.ts +1 -1
  31. package/dist/irdevices/airconditioners.d.ts.map +1 -1
  32. package/dist/irdevices/airconditioners.js +15 -14
  33. package/dist/irdevices/airconditioners.js.map +1 -1
  34. package/dist/irdevices/airpurifiers.d.ts +3 -3
  35. package/dist/irdevices/airpurifiers.d.ts.map +1 -1
  36. package/dist/irdevices/airpurifiers.js +19 -18
  37. package/dist/irdevices/airpurifiers.js.map +1 -1
  38. package/dist/irdevices/cameras.d.ts +1 -1
  39. package/dist/irdevices/cameras.d.ts.map +1 -1
  40. package/dist/irdevices/cameras.js +15 -14
  41. package/dist/irdevices/cameras.js.map +1 -1
  42. package/dist/irdevices/fans.d.ts +1 -1
  43. package/dist/irdevices/fans.d.ts.map +1 -1
  44. package/dist/irdevices/fans.js +15 -14
  45. package/dist/irdevices/fans.js.map +1 -1
  46. package/dist/irdevices/lights.d.ts +1 -1
  47. package/dist/irdevices/lights.d.ts.map +1 -1
  48. package/dist/irdevices/lights.js +15 -14
  49. package/dist/irdevices/lights.js.map +1 -1
  50. package/dist/irdevices/others.d.ts +2 -2
  51. package/dist/irdevices/others.d.ts.map +1 -1
  52. package/dist/irdevices/others.js +19 -18
  53. package/dist/irdevices/others.js.map +1 -1
  54. package/dist/irdevices/tvs.d.ts +1 -1
  55. package/dist/irdevices/tvs.d.ts.map +1 -1
  56. package/dist/irdevices/tvs.js +15 -14
  57. package/dist/irdevices/tvs.js.map +1 -1
  58. package/dist/irdevices/vacuumcleaners.d.ts +1 -1
  59. package/dist/irdevices/vacuumcleaners.d.ts.map +1 -1
  60. package/dist/irdevices/vacuumcleaners.js +15 -14
  61. package/dist/irdevices/vacuumcleaners.js.map +1 -1
  62. package/dist/irdevices/waterheaters.d.ts +1 -1
  63. package/dist/irdevices/waterheaters.d.ts.map +1 -1
  64. package/dist/irdevices/waterheaters.js +15 -14
  65. package/dist/irdevices/waterheaters.js.map +1 -1
  66. package/dist/settings.d.ts +6 -6
  67. package/dist/settings.d.ts.map +1 -1
  68. package/package.json +1 -1
  69. package/src/devices/bots.ts +27 -24
  70. package/src/devices/colorbulb.ts +13 -10
  71. package/src/devices/contact.ts +38 -32
  72. package/src/devices/curtains.ts +13 -10
  73. package/src/devices/humidifiers.ts +13 -10
  74. package/src/devices/meters.ts +42 -36
  75. package/src/devices/motion.ts +38 -32
  76. package/src/devices/plugs.ts +38 -32
  77. package/src/irdevices/airconditioners.ts +15 -14
  78. package/src/irdevices/airpurifiers.ts +19 -18
  79. package/src/irdevices/cameras.ts +15 -14
  80. package/src/irdevices/fans.ts +15 -14
  81. package/src/irdevices/lights.ts +15 -14
  82. package/src/irdevices/others.ts +19 -18
  83. package/src/irdevices/tvs.ts +15 -14
  84. package/src/irdevices/vacuumcleaners.ts +15 -14
  85. package/src/irdevices/waterheaters.ts +15 -14
  86. package/src/settings.ts +6 -6
@@ -42,7 +42,7 @@ export interface devicesConfig extends device {
42
42
  contact?: contact;
43
43
  motion?: motion;
44
44
  colorbulb?: colorbulb;
45
- plug?: undefined;
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?: undefined;
96
- ircam?: undefined;
97
- irlight?: undefined;
98
- irvc?: undefined;
99
- irwh?: undefined;
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;
@@ -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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M,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,EAAE,CAAC,KAAA,YAiC7B;AAED,wBAAgB,MAAM,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,YAyC1B;AAED,wBAAgB,KAAK,CAAC,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.12",
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",
@@ -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.bot !== undefined) {
483
- if (device.ble !== undefined) {
484
- config['ble'] = device.ble;
485
- }
486
- if (device.logging !== undefined) {
487
- config['logging'] = device.logging;
488
- }
489
- if (device.refreshRate !== undefined) {
490
- config['refreshRate'] = device.refreshRate;
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';
@@ -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.colorbulb !== undefined) {
220
- if (device.ble !== undefined) {
221
- config['ble'] = device.ble;
222
- }
223
- if (device.logging !== undefined) {
224
- config['logging'] = device.logging;
225
- }
226
- if (device.refreshRate !== undefined) {
227
- config['refreshRate'] = device.refreshRate;
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
  }
@@ -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
- if (device.contact !== undefined) {
160
- this.warnLog(`Contact Sensor: ${this.accessory.displayName} Config: ${JSON.stringify(device.contact)}`);
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 (this.device.refreshRate) {
166
- this.deviceRefreshRate = this.accessory.context.refreshRate = this.device.refreshRate;
167
- if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
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
- if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
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 (this.device.scanDuration) {
180
- this.scanDuration = this.accessory.context.scanDuration = this.device.scanDuration;
181
- if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
182
- this.warnLog(`Contact Sensor: ${this.accessory.displayName} Using Device Config scanDuration: ${this.scanDuration}`);
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.platform.debugMode || (this.deviceLogging === 'debug')) {
187
- this.warnLog(`Contact Sensor: ${this.accessory.displayName} Using Default scanDuration: ${this.scanDuration}`);
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 = 'debug';
195
- this.warnLog(`Contact Sensor: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
196
- } else if (this.device.logging) {
197
- this.deviceLogging = this.accessory.context.logging = this.device.logging;
198
- if (this.deviceLogging === 'debug' || this.deviceLogging === 'standard') {
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
- if (this.deviceLogging === 'debug' || this.deviceLogging === 'standard') {
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
 
@@ -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.curtain !== undefined) {
215
- if (device.ble !== undefined) {
216
- config['ble'] = device.ble;
217
- }
218
- if (device.logging !== undefined) {
219
- config['logging'] = device.logging;
220
- }
221
- if (device.refreshRate !== undefined) {
222
- config['refreshRate'] = device.refreshRate;
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.humidifier !== undefined) {
204
- if (device.ble !== undefined) {
205
- config['ble'] = device.ble;
206
- }
207
- if (device.logging !== undefined) {
208
- config['logging'] = device.logging;
209
- }
210
- if (device.refreshRate !== undefined) {
211
- config['refreshRate'] = device.refreshRate;
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
  }
@@ -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
- if (device.meter !== undefined || device.ble !== undefined) {
179
- this.warnLog(`Meter: ${this.accessory.displayName} Config: ${JSON.stringify(device.meter)}, BLE: ${device.ble}`);
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 (this.device.refreshRate) {
185
- this.deviceRefreshRate = this.accessory.context.refreshRate = this.device.refreshRate;
186
- if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
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
- if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
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 (this.device.scanDuration) {
199
- this.scanDuration = this.accessory.context.scanDuration = this.device.scanDuration;
200
- if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
201
- this.warnLog(`Meter: ${this.accessory.displayName} Using Device Config scanDuration: ${this.scanDuration}`);
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.platform.debugMode || (this.deviceLogging === 'debug')) {
206
- this.warnLog(`Meter: ${this.accessory.displayName} Using Default scanDuration: ${this.scanDuration}`);
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 = 'debug';
214
- this.warnLog(`Meter: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
215
- } else if (this.device.logging) {
216
- this.deviceLogging = this.accessory.context.logging = this.device.logging;
217
- if (this.deviceLogging === 'debug' || this.deviceLogging === 'standard') {
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
- if (this.deviceLogging === 'debug' || this.deviceLogging === 'standard') {
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(`Bot: ${this.accessory.displayName} BatteryLevel: ${this.BatteryLevel}`);
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(`Bot: ${this.accessory.displayName} updateCharacteristic BatteryLevel: ${this.BatteryLevel}`);
427
+ this.debugLog(`Meter: ${this.accessory.displayName} updateCharacteristic BatteryLevel: ${this.BatteryLevel}`);
422
428
  }
423
429
  if (this.StatusLowBattery === undefined) {
424
- this.debugLog(`Bot: ${this.accessory.displayName} StatusLowBattery: ${this.StatusLowBattery}`);
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(`Bot: ${this.accessory.displayName} updateCharacteristic StatusLowBattery: ${this.StatusLowBattery}`);
433
+ this.debugLog(`Meter: ${this.accessory.displayName} updateCharacteristic StatusLowBattery: ${this.StatusLowBattery}`);
428
434
  }
429
435
  }
430
436
  }
@@ -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
- if (device.motion !== undefined) {
144
- this.warnLog(`Motion Sensor: ${this.accessory.displayName} Config: ${JSON.stringify(device.motion)}`);
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 (this.device.refreshRate) {
150
- this.deviceRefreshRate = this.accessory.context.refreshRate = this.device.refreshRate;
151
- if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
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
- if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
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 (this.device.scanDuration) {
164
- this.scanDuration = this.accessory.context.scanDuration = this.device.scanDuration;
165
- if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
166
- this.warnLog(`Motion Sensor: ${this.accessory.displayName} Using Device Config scanDuration: ${this.scanDuration}`);
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.platform.debugMode || (this.deviceLogging === 'debug')) {
171
- this.warnLog(`Motion Sensor: ${this.accessory.displayName} Using Default scanDuration: ${this.scanDuration}`);
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 = 'debug';
179
- this.warnLog(`Motion Sensor: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
180
- } else if (this.device.logging) {
181
- this.deviceLogging = this.accessory.context.logging = this.device.logging;
182
- if (this.deviceLogging === 'debug' || this.deviceLogging === 'standard') {
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
- if (this.deviceLogging === 'debug' || this.deviceLogging === 'standard') {
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