@switchbot/homebridge-switchbot 1.7.1-beta.9 → 1.8.1-beta.2

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 (92) hide show
  1. package/CHANGELOG.md +10 -1
  2. package/config.schema.json +3 -3
  3. package/dist/devices/bots.d.ts +15 -14
  4. package/dist/devices/bots.d.ts.map +1 -1
  5. package/dist/devices/bots.js +163 -154
  6. package/dist/devices/bots.js.map +1 -1
  7. package/dist/devices/colorbulb.d.ts +5 -4
  8. package/dist/devices/colorbulb.d.ts.map +1 -1
  9. package/dist/devices/colorbulb.js +70 -61
  10. package/dist/devices/colorbulb.js.map +1 -1
  11. package/dist/devices/contact.d.ts +8 -7
  12. package/dist/devices/contact.d.ts.map +1 -1
  13. package/dist/devices/contact.js +82 -74
  14. package/dist/devices/contact.js.map +1 -1
  15. package/dist/devices/curtains.d.ts +8 -7
  16. package/dist/devices/curtains.d.ts.map +1 -1
  17. package/dist/devices/curtains.js +104 -101
  18. package/dist/devices/curtains.js.map +1 -1
  19. package/dist/devices/humidifiers.d.ts +5 -4
  20. package/dist/devices/humidifiers.d.ts.map +1 -1
  21. package/dist/devices/humidifiers.js +74 -62
  22. package/dist/devices/humidifiers.js.map +1 -1
  23. package/dist/devices/meters.d.ts +4 -3
  24. package/dist/devices/meters.d.ts.map +1 -1
  25. package/dist/devices/meters.js +68 -56
  26. package/dist/devices/meters.js.map +1 -1
  27. package/dist/devices/motion.d.ts +6 -5
  28. package/dist/devices/motion.d.ts.map +1 -1
  29. package/dist/devices/motion.js +82 -70
  30. package/dist/devices/motion.js.map +1 -1
  31. package/dist/devices/plugs.d.ts +4 -3
  32. package/dist/devices/plugs.d.ts.map +1 -1
  33. package/dist/devices/plugs.js +64 -52
  34. package/dist/devices/plugs.js.map +1 -1
  35. package/dist/irdevices/airconditioners.d.ts +2 -1
  36. package/dist/irdevices/airconditioners.d.ts.map +1 -1
  37. package/dist/irdevices/airconditioners.js +29 -22
  38. package/dist/irdevices/airconditioners.js.map +1 -1
  39. package/dist/irdevices/airpurifiers.d.ts +4 -3
  40. package/dist/irdevices/airpurifiers.d.ts.map +1 -1
  41. package/dist/irdevices/airpurifiers.js +33 -26
  42. package/dist/irdevices/airpurifiers.js.map +1 -1
  43. package/dist/irdevices/cameras.d.ts +2 -1
  44. package/dist/irdevices/cameras.d.ts.map +1 -1
  45. package/dist/irdevices/cameras.js +29 -22
  46. package/dist/irdevices/cameras.js.map +1 -1
  47. package/dist/irdevices/fans.d.ts +2 -1
  48. package/dist/irdevices/fans.d.ts.map +1 -1
  49. package/dist/irdevices/fans.js +29 -22
  50. package/dist/irdevices/fans.js.map +1 -1
  51. package/dist/irdevices/lights.d.ts +2 -1
  52. package/dist/irdevices/lights.d.ts.map +1 -1
  53. package/dist/irdevices/lights.js +29 -22
  54. package/dist/irdevices/lights.js.map +1 -1
  55. package/dist/irdevices/others.d.ts +3 -2
  56. package/dist/irdevices/others.d.ts.map +1 -1
  57. package/dist/irdevices/others.js +41 -34
  58. package/dist/irdevices/others.js.map +1 -1
  59. package/dist/irdevices/tvs.d.ts +2 -1
  60. package/dist/irdevices/tvs.d.ts.map +1 -1
  61. package/dist/irdevices/tvs.js +29 -22
  62. package/dist/irdevices/tvs.js.map +1 -1
  63. package/dist/irdevices/vacuumcleaners.d.ts +2 -1
  64. package/dist/irdevices/vacuumcleaners.d.ts.map +1 -1
  65. package/dist/irdevices/vacuumcleaners.js +29 -22
  66. package/dist/irdevices/vacuumcleaners.js.map +1 -1
  67. package/dist/irdevices/waterheaters.d.ts +2 -1
  68. package/dist/irdevices/waterheaters.d.ts.map +1 -1
  69. package/dist/irdevices/waterheaters.js +29 -22
  70. package/dist/irdevices/waterheaters.js.map +1 -1
  71. package/dist/settings.d.ts +7 -1
  72. package/dist/settings.d.ts.map +1 -1
  73. package/dist/settings.js.map +1 -1
  74. package/package.json +1 -1
  75. package/src/devices/bots.ts +170 -162
  76. package/src/devices/colorbulb.ts +69 -61
  77. package/src/devices/contact.ts +83 -75
  78. package/src/devices/curtains.ts +103 -100
  79. package/src/devices/humidifiers.ts +73 -60
  80. package/src/devices/meters.ts +67 -54
  81. package/src/devices/motion.ts +81 -68
  82. package/src/devices/plugs.ts +63 -50
  83. package/src/irdevices/airconditioners.ts +28 -20
  84. package/src/irdevices/airpurifiers.ts +32 -24
  85. package/src/irdevices/cameras.ts +28 -20
  86. package/src/irdevices/fans.ts +28 -20
  87. package/src/irdevices/lights.ts +28 -20
  88. package/src/irdevices/others.ts +40 -32
  89. package/src/irdevices/tvs.ts +28 -20
  90. package/src/irdevices/vacuumcleaners.ts +28 -20
  91. package/src/irdevices/waterheaters.ts +28 -20
  92. package/src/settings.ts +7 -1
@@ -35,7 +35,8 @@ export class Fan {
35
35
  public device: irdevice & irDevicesConfig,
36
36
  ) {
37
37
  // default placeholders
38
- this.logs();
38
+ this.logs(device);
39
+ this.config(device);
39
40
  if (this.Active === undefined) {
40
41
  this.Active = this.platform.Characteristic.Active.INACTIVE;
41
42
  } else {
@@ -116,25 +117,6 @@ export class Fan {
116
117
  }
117
118
  }
118
119
 
119
- logs() {
120
- if (this.platform.debugMode) {
121
- this.deviceLogging = this.accessory.context.logging = 'debug';
122
- this.warnLog(`Fan: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
123
- } else if (this.device.logging) {
124
- this.deviceLogging = this.accessory.context.logging = this.device.logging;
125
- if (this.deviceLogging === 'debug' || this.deviceLogging === 'standard') {
126
- this.warnLog(`Fan: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
127
- }
128
- } else if (this.platform.config.options?.logging) {
129
- this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
130
- if (this.deviceLogging === 'debug' || this.deviceLogging === 'standard') {
131
- this.warnLog(`Fan: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
132
- }
133
- } else {
134
- this.deviceLogging = this.accessory.context.logging = 'standard';
135
- }
136
- }
137
-
138
120
  private SwingModeSet(value: CharacteristicValue) {
139
121
  this.debugLog(`Fan: ${this.accessory.displayName} SwingMode: ${value}`);
140
122
  if (value > this.SwingMode) {
@@ -311,6 +293,32 @@ export class Fan {
311
293
  //throw new this.platform.api.hap.HapStatusError(HAPStatus.SERVICE_COMMUNICATION_FAILURE);
312
294
  }
313
295
 
296
+ config(device: irdevice & irDevicesConfig) {
297
+ const config: any = device.irfan;
298
+ if (device.logging !== undefined) {
299
+ config['logging'] = device.logging;
300
+ }
301
+ if (config !== undefined) {
302
+ this.warnLog(`Fan: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
303
+ }
304
+ }
305
+
306
+ logs(device: irdevice & irDevicesConfig) {
307
+ if (this.platform.debugMode) {
308
+ this.deviceLogging = this.accessory.context.logging = 'debugMode';
309
+ this.debugLog(`Fan: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
310
+ } else if (device.logging) {
311
+ this.deviceLogging = this.accessory.context.logging = device.logging;
312
+ this.debugLog(`Fan: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
313
+ } else if (this.platform.config.options?.logging) {
314
+ this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
315
+ this.debugLog(`Fan: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
316
+ } else {
317
+ this.deviceLogging = this.accessory.context.logging = 'standard';
318
+ this.debugLog(`Fan: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
319
+ }
320
+ }
321
+
314
322
  /**
315
323
  * Logging for Device
316
324
  */
@@ -25,7 +25,8 @@ export class Light {
25
25
  public device: irdevice & irDevicesConfig,
26
26
  ) {
27
27
  // default placeholders
28
- this.logs();
28
+ this.logs(device);
29
+ this.config(device);
29
30
  if (this.On === undefined) {
30
31
  this.On = false;
31
32
  } else {
@@ -72,25 +73,6 @@ export class Light {
72
73
  });*/
73
74
  }
74
75
 
75
- logs() {
76
- if (this.platform.debugMode) {
77
- this.deviceLogging = this.accessory.context.logging = 'debug';
78
- this.warnLog(`Light: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
79
- } else if (this.device.logging) {
80
- this.deviceLogging = this.accessory.context.logging = this.device.logging;
81
- if (this.deviceLogging === 'debug' || this.deviceLogging === 'standard') {
82
- this.warnLog(`Light: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
83
- }
84
- } else if (this.platform.config.options?.logging) {
85
- this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
86
- if (this.deviceLogging === 'debug' || this.deviceLogging === 'standard') {
87
- this.warnLog(`Light: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
88
- }
89
- } else {
90
- this.deviceLogging = this.accessory.context.logging = 'standard';
91
- }
92
- }
93
-
94
76
  private OnSet(value: CharacteristicValue) {
95
77
  this.debugLog(`Light: ${this.accessory.displayName} On: ${value}`);
96
78
  this.On = value;
@@ -221,6 +203,32 @@ export class Light {
221
203
  //throw new this.platform.api.hap.HapStatusError(HAPStatus.SERVICE_COMMUNICATION_FAILURE);
222
204
  }
223
205
 
206
+ config(device: irdevice & irDevicesConfig) {
207
+ const config: any = device.irlight;
208
+ if (device.logging !== undefined) {
209
+ config['logging'] = device.logging;
210
+ }
211
+ if (config !== undefined) {
212
+ this.warnLog(`Light: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
213
+ }
214
+ }
215
+
216
+ logs(device: irdevice & irDevicesConfig) {
217
+ if (this.platform.debugMode) {
218
+ this.deviceLogging = this.accessory.context.logging = 'debugMode';
219
+ this.debugLog(`Light: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
220
+ } else if (device.logging) {
221
+ this.deviceLogging = this.accessory.context.logging = device.logging;
222
+ this.debugLog(`Light: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
223
+ } else if (this.platform.config.options?.logging) {
224
+ this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
225
+ this.debugLog(`Light: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
226
+ } else {
227
+ this.deviceLogging = this.accessory.context.logging = 'standard';
228
+ this.debugLog(`Light: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
229
+ }
230
+ }
231
+
224
232
  /**
225
233
  * Logging for Device
226
234
  */
@@ -26,8 +26,9 @@ export class Others {
26
26
  public device: irdevice & irDevicesConfig,
27
27
  ) {
28
28
  // default placeholders
29
- this.logs();
30
- this.deviceType();
29
+ this.logs(device);
30
+ this.deviceType(device);
31
+ this.config(device);
31
32
  if (this.Active === undefined) {
32
33
  this.Active = this.platform.Characteristic.Active.INACTIVE;
33
34
  } else {
@@ -65,36 +66,6 @@ export class Others {
65
66
  }
66
67
  }
67
68
 
68
- deviceType() {
69
- if (this.device?.other?.deviceType) {
70
- this.otherDeviceType = this.accessory.context.deviceType = this.device?.other?.deviceType;
71
- if (this.deviceLogging === 'debug' || this.deviceLogging === 'standard') {
72
- this.warnLog(`Other: ${this.accessory.displayName} Using Device Type: ${this.otherDeviceType}`);
73
- }
74
- } else {
75
- this.errorLog(`Other: ${this.accessory.displayName} No Device Type Set, deviceType: ${this.device.other?.deviceType}`);
76
- }
77
- }
78
-
79
- logs() {
80
- if (this.platform.debugMode) {
81
- this.deviceLogging = this.accessory.context.logging = 'debug';
82
- this.warnLog(`Other: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
83
- } else if (this.device.logging) {
84
- this.deviceLogging = this.accessory.context.logging = this.device.logging;
85
- if (this.deviceLogging === 'debug' || this.deviceLogging === 'standard') {
86
- this.warnLog(`Other: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
87
- }
88
- } else if (this.platform.config.options?.logging) {
89
- this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
90
- if (this.deviceLogging === 'debug' || this.deviceLogging === 'standard') {
91
- this.warnLog(`Other: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
92
- }
93
- } else {
94
- this.deviceLogging = this.accessory.context.logging = 'standard';
95
- }
96
- }
97
-
98
69
  private ActiveSet(value: CharacteristicValue) {
99
70
  this.debugLog(`Other: ${this.accessory.displayName} On: ${value}`);
100
71
  if (this.Active) {
@@ -230,6 +201,43 @@ export class Others {
230
201
  //throw new this.platform.api.hap.HapStatusError(HAPStatus.SERVICE_COMMUNICATION_FAILURE);
231
202
  }
232
203
 
204
+ deviceType(device: irdevice & irDevicesConfig) {
205
+ if (device.other?.deviceType) {
206
+ this.otherDeviceType = this.accessory.context.deviceType = device.other.deviceType;
207
+ if (this.deviceLogging === 'debug' || this.deviceLogging === 'standard') {
208
+ this.warnLog(`Other: ${this.accessory.displayName} Using Device Type: ${this.otherDeviceType}`);
209
+ }
210
+ } else {
211
+ this.errorLog(`Other: ${this.accessory.displayName} No Device Type Set, deviceType: ${this.device.other?.deviceType}`);
212
+ }
213
+ }
214
+
215
+ config(device: irdevice & irDevicesConfig) {
216
+ const config: any = device.other;
217
+ if (device.logging !== undefined) {
218
+ config['logging'] = device.logging;
219
+ }
220
+ if (config !== undefined) {
221
+ this.warnLog(`Other: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
222
+ }
223
+ }
224
+
225
+ logs(device: irdevice & irDevicesConfig) {
226
+ if (this.platform.debugMode) {
227
+ this.deviceLogging = this.accessory.context.logging = 'debugMode';
228
+ this.debugLog(`Other: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
229
+ } else if (device.logging) {
230
+ this.deviceLogging = this.accessory.context.logging = device.logging;
231
+ this.debugLog(`Other: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
232
+ } else if (this.platform.config.options?.logging) {
233
+ this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
234
+ this.debugLog(`Other: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
235
+ } else {
236
+ this.deviceLogging = this.accessory.context.logging = 'standard';
237
+ this.debugLog(`Other: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
238
+ }
239
+ }
240
+
233
241
  /**
234
242
  * Logging for Device
235
243
  */
@@ -30,7 +30,8 @@ export class TV {
30
30
  public device: irdevice & irDevicesConfig,
31
31
  ) {
32
32
  // default placeholders
33
- this.logs();
33
+ this.logs(device);
34
+ this.config(device);
34
35
  if (this.Active === undefined) {
35
36
  this.Active = this.platform.Characteristic.Active.INACTIVE;
36
37
  } else {
@@ -128,25 +129,6 @@ export class TV {
128
129
  .onSet(this.VolumeSelectorSet.bind(this));
129
130
  }
130
131
 
131
- logs() {
132
- if (this.platform.debugMode) {
133
- this.deviceLogging = this.accessory.context.logging = 'debug';
134
- this.warnLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
135
- } else if (this.device.logging) {
136
- this.deviceLogging = this.accessory.context.logging = this.device.logging;
137
- if (this.deviceLogging === 'debug' || this.deviceLogging === 'standard') {
138
- this.warnLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
139
- }
140
- } else if (this.platform.config.options?.logging) {
141
- this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
142
- if (this.deviceLogging === 'debug' || this.deviceLogging === 'standard') {
143
- this.warnLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
144
- }
145
- } else {
146
- this.deviceLogging = this.accessory.context.logging = 'standard';
147
- }
148
- }
149
-
150
132
  private VolumeSelectorSet(value: CharacteristicValue) {
151
133
  this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} VolumeSelector: ${value}`);
152
134
  if (value === this.platform.Characteristic.VolumeSelector.INCREMENT) {
@@ -427,6 +409,32 @@ export class TV {
427
409
  //throw new this.platform.api.hap.HapStatusError(HAPStatus.SERVICE_COMMUNICATION_FAILURE);
428
410
  }
429
411
 
412
+ config(device: irdevice & irDevicesConfig) {
413
+ const config: any = device.irtv;
414
+ if (device.logging !== undefined) {
415
+ config['logging'] = device.logging;
416
+ }
417
+ if (config !== undefined) {
418
+ this.warnLog(`${this.device.remoteType}: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
419
+ }
420
+ }
421
+
422
+ logs(device: irdevice & irDevicesConfig) {
423
+ if (this.platform.debugMode) {
424
+ this.deviceLogging = this.accessory.context.logging = 'debugMode';
425
+ this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
426
+ } else if (device.logging) {
427
+ this.deviceLogging = this.accessory.context.logging = device.logging;
428
+ this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
429
+ } else if (this.platform.config.options?.logging) {
430
+ this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
431
+ this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
432
+ } else {
433
+ this.deviceLogging = this.accessory.context.logging = 'standard';
434
+ this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
435
+ }
436
+ }
437
+
430
438
  /**
431
439
  * Logging for Device
432
440
  */
@@ -25,7 +25,8 @@ export class VacuumCleaner {
25
25
  public device: irdevice & irDevicesConfig,
26
26
  ) {
27
27
  // default placeholders
28
- this.logs();
28
+ this.logs(device);
29
+ this.config(device);
29
30
  if (this.On === undefined) {
30
31
  this.On = false;
31
32
  } else {
@@ -57,25 +58,6 @@ export class VacuumCleaner {
57
58
  this.service.getCharacteristic(this.platform.Characteristic.On).onSet(this.OnSet.bind(this));
58
59
  }
59
60
 
60
- logs() {
61
- if (this.platform.debugMode) {
62
- this.deviceLogging = this.accessory.context.logging = 'debug';
63
- this.warnLog(`Vacuum Cleaner: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
64
- } else if (this.device.logging) {
65
- this.deviceLogging = this.accessory.context.logging = this.device.logging;
66
- if (this.deviceLogging === 'debug' || this.deviceLogging === 'standard') {
67
- this.warnLog(`Vacuum Cleaner: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
68
- }
69
- } else if (this.platform.config.options?.logging) {
70
- this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
71
- if (this.deviceLogging === 'debug' || this.deviceLogging === 'standard') {
72
- this.warnLog(`Vacuum Cleaner: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
73
- }
74
- } else {
75
- this.deviceLogging = this.accessory.context.logging = 'standard';
76
- }
77
- }
78
-
79
61
  private OnSet(value: CharacteristicValue) {
80
62
  this.debugLog(`Vacuum Cleaner: ${this.accessory.displayName} On: ${value}`);
81
63
  this.On = value;
@@ -187,6 +169,32 @@ export class VacuumCleaner {
187
169
  //throw new this.platform.api.hap.HapStatusError(HAPStatus.SERVICE_COMMUNICATION_FAILURE);
188
170
  }
189
171
 
172
+ config(device: irdevice & irDevicesConfig) {
173
+ const config: any = device.irvc;
174
+ if (device.logging !== undefined) {
175
+ config['logging'] = device.logging;
176
+ }
177
+ if (config !== undefined) {
178
+ this.warnLog(`Vacuum Cleaner: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
179
+ }
180
+ }
181
+
182
+ logs(device: irdevice & irDevicesConfig) {
183
+ if (this.platform.debugMode) {
184
+ this.deviceLogging = this.accessory.context.logging = 'debugMode';
185
+ this.debugLog(`Vacuum Cleaner: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
186
+ } else if (device.logging) {
187
+ this.deviceLogging = this.accessory.context.logging = device.logging;
188
+ this.debugLog(`Vacuum Cleaner: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
189
+ } else if (this.platform.config.options?.logging) {
190
+ this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
191
+ this.debugLog(`Vacuum Cleaner: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
192
+ } else {
193
+ this.deviceLogging = this.accessory.context.logging = 'standard';
194
+ this.debugLog(`Vacuum Cleaner: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
195
+ }
196
+ }
197
+
190
198
  /**
191
199
  * Logging for Device
192
200
  */
@@ -25,7 +25,8 @@ export class WaterHeater {
25
25
  public device: irdevice & irDevicesConfig,
26
26
  ) {
27
27
  // default placeholders
28
- this.logs();
28
+ this.logs(device);
29
+ this.config(device);
29
30
  if (this.Active === undefined) {
30
31
  this.Active = this.platform.Characteristic.Active.INACTIVE;
31
32
  } else {
@@ -66,25 +67,6 @@ export class WaterHeater {
66
67
  this.service.getCharacteristic(this.platform.Characteristic.Active).onSet(this.ActiveSet.bind(this));
67
68
  }
68
69
 
69
- logs() {
70
- if (this.platform.debugMode) {
71
- this.deviceLogging = this.accessory.context.logging = 'debug';
72
- this.warnLog(`Water Heater: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
73
- } else if (this.device.logging) {
74
- this.deviceLogging = this.accessory.context.logging = this.device.logging;
75
- if (this.deviceLogging === 'debug' || this.deviceLogging === 'standard') {
76
- this.warnLog(`Water Heater: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
77
- }
78
- } else if (this.platform.config.options?.logging) {
79
- this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
80
- if (this.deviceLogging === 'debug' || this.deviceLogging === 'standard') {
81
- this.warnLog(`Water Heater: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
82
- }
83
- } else {
84
- this.deviceLogging = this.accessory.context.logging = 'standard';
85
- }
86
- }
87
-
88
70
  private ActiveSet(value: CharacteristicValue) {
89
71
  this.debugLog(`Water Heater: ${this.accessory.displayName} Active: ${value}`);
90
72
  if (value === this.platform.Characteristic.Active.INACTIVE) {
@@ -201,6 +183,32 @@ export class WaterHeater {
201
183
  //throw new this.platform.api.hap.HapStatusError(HAPStatus.SERVICE_COMMUNICATION_FAILURE);
202
184
  }
203
185
 
186
+ config(device: irdevice & irDevicesConfig) {
187
+ const config: any = device.irwh;
188
+ if (device.logging !== undefined) {
189
+ config['logging'] = device.logging;
190
+ }
191
+ if (config !== undefined) {
192
+ this.warnLog(`Water Heater: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
193
+ }
194
+ }
195
+
196
+ logs(device: irdevice & irDevicesConfig) {
197
+ if (this.platform.debugMode) {
198
+ this.deviceLogging = this.accessory.context.logging = 'debugMode';
199
+ this.debugLog(`Water Heater: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
200
+ } else if (device.logging) {
201
+ this.deviceLogging = this.accessory.context.logging = device.logging;
202
+ this.debugLog(`Water Heater: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
203
+ } else if (this.platform.config.options?.logging) {
204
+ this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
205
+ this.debugLog(`Water Heater: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
206
+ } else {
207
+ this.deviceLogging = this.accessory.context.logging = 'standard';
208
+ this.debugLog(`Water Heater: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
209
+ }
210
+ }
211
+
204
212
  /**
205
213
  * Logging for Device
206
214
  */
package/src/settings.ts CHANGED
@@ -50,6 +50,7 @@ export interface devicesConfig extends device {
50
50
  contact?: contact;
51
51
  motion?: motion;
52
52
  colorbulb?: colorbulb;
53
+ plug?: Record<any, any>;
53
54
  ble?: string;
54
55
  scanDuration?: number;
55
56
  hide_device?: boolean;
@@ -77,7 +78,7 @@ export type curtain = {
77
78
  hide_lightsensor?: boolean;
78
79
  set_minLux?: number;
79
80
  set_maxLux?: number;
80
- refreshRate?: number;
81
+ updateRate?: number;
81
82
  set_max?: number;
82
83
  set_min?: number;
83
84
  set_minStep?: number;
@@ -107,6 +108,11 @@ export interface irDevicesConfig extends irdevice {
107
108
  logging?: string;
108
109
  irfan?: irfan;
109
110
  irair?: irair;
111
+ irpur?: Record<any, any>;
112
+ ircam?: Record<any, any>;
113
+ irlight?: Record<any, any>;
114
+ irvc?: Record<any, any>;
115
+ irwh?: Record<any, any>;
110
116
  irtv?: irtv;
111
117
  other?: other;
112
118
  hide_device?: boolean;