@switchbot/homebridge-switchbot 1.8.1-beta.1 → 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 (86) hide show
  1. package/dist/devices/bots.d.ts +15 -15
  2. package/dist/devices/bots.d.ts.map +1 -1
  3. package/dist/devices/bots.js +159 -159
  4. package/dist/devices/bots.js.map +1 -1
  5. package/dist/devices/colorbulb.d.ts +5 -5
  6. package/dist/devices/colorbulb.d.ts.map +1 -1
  7. package/dist/devices/colorbulb.js +66 -66
  8. package/dist/devices/colorbulb.js.map +1 -1
  9. package/dist/devices/contact.d.ts +8 -8
  10. package/dist/devices/contact.d.ts.map +1 -1
  11. package/dist/devices/contact.js +78 -78
  12. package/dist/devices/contact.js.map +1 -1
  13. package/dist/devices/curtains.d.ts +7 -7
  14. package/dist/devices/curtains.d.ts.map +1 -1
  15. package/dist/devices/curtains.js +97 -97
  16. package/dist/devices/curtains.js.map +1 -1
  17. package/dist/devices/humidifiers.d.ts +5 -5
  18. package/dist/devices/humidifiers.d.ts.map +1 -1
  19. package/dist/devices/humidifiers.js +69 -69
  20. package/dist/devices/humidifiers.js.map +1 -1
  21. package/dist/devices/meters.d.ts +4 -4
  22. package/dist/devices/meters.d.ts.map +1 -1
  23. package/dist/devices/meters.js +60 -60
  24. package/dist/devices/meters.js.map +1 -1
  25. package/dist/devices/motion.d.ts +6 -6
  26. package/dist/devices/motion.d.ts.map +1 -1
  27. package/dist/devices/motion.js +78 -78
  28. package/dist/devices/motion.js.map +1 -1
  29. package/dist/devices/plugs.d.ts +4 -4
  30. package/dist/devices/plugs.d.ts.map +1 -1
  31. package/dist/devices/plugs.js +60 -60
  32. package/dist/devices/plugs.js.map +1 -1
  33. package/dist/irdevices/airconditioners.d.ts +2 -2
  34. package/dist/irdevices/airconditioners.d.ts.map +1 -1
  35. package/dist/irdevices/airconditioners.js +27 -27
  36. package/dist/irdevices/airconditioners.js.map +1 -1
  37. package/dist/irdevices/airpurifiers.d.ts +2 -2
  38. package/dist/irdevices/airpurifiers.d.ts.map +1 -1
  39. package/dist/irdevices/airpurifiers.js +27 -27
  40. package/dist/irdevices/airpurifiers.js.map +1 -1
  41. package/dist/irdevices/cameras.d.ts +2 -2
  42. package/dist/irdevices/cameras.d.ts.map +1 -1
  43. package/dist/irdevices/cameras.js +27 -27
  44. package/dist/irdevices/cameras.js.map +1 -1
  45. package/dist/irdevices/fans.d.ts +2 -2
  46. package/dist/irdevices/fans.d.ts.map +1 -1
  47. package/dist/irdevices/fans.js +27 -27
  48. package/dist/irdevices/fans.js.map +1 -1
  49. package/dist/irdevices/lights.d.ts +2 -2
  50. package/dist/irdevices/lights.d.ts.map +1 -1
  51. package/dist/irdevices/lights.js +27 -27
  52. package/dist/irdevices/lights.js.map +1 -1
  53. package/dist/irdevices/others.d.ts +3 -3
  54. package/dist/irdevices/others.d.ts.map +1 -1
  55. package/dist/irdevices/others.js +38 -38
  56. package/dist/irdevices/others.js.map +1 -1
  57. package/dist/irdevices/tvs.d.ts +2 -2
  58. package/dist/irdevices/tvs.d.ts.map +1 -1
  59. package/dist/irdevices/tvs.js +27 -27
  60. package/dist/irdevices/tvs.js.map +1 -1
  61. package/dist/irdevices/vacuumcleaners.d.ts +2 -2
  62. package/dist/irdevices/vacuumcleaners.d.ts.map +1 -1
  63. package/dist/irdevices/vacuumcleaners.js +27 -27
  64. package/dist/irdevices/vacuumcleaners.js.map +1 -1
  65. package/dist/irdevices/waterheaters.d.ts +2 -2
  66. package/dist/irdevices/waterheaters.d.ts.map +1 -1
  67. package/dist/irdevices/waterheaters.js +27 -27
  68. package/dist/irdevices/waterheaters.js.map +1 -1
  69. package/package.json +1 -1
  70. package/src/devices/bots.ts +166 -166
  71. package/src/devices/colorbulb.ts +65 -65
  72. package/src/devices/contact.ts +79 -79
  73. package/src/devices/curtains.ts +95 -95
  74. package/src/devices/humidifiers.ts +68 -68
  75. package/src/devices/meters.ts +59 -59
  76. package/src/devices/motion.ts +77 -77
  77. package/src/devices/plugs.ts +59 -59
  78. package/src/irdevices/airconditioners.ts +26 -26
  79. package/src/irdevices/airpurifiers.ts +26 -26
  80. package/src/irdevices/cameras.ts +26 -26
  81. package/src/irdevices/fans.ts +26 -26
  82. package/src/irdevices/lights.ts +26 -26
  83. package/src/irdevices/others.ts +37 -37
  84. package/src/irdevices/tvs.ts +26 -26
  85. package/src/irdevices/vacuumcleaners.ts +26 -26
  86. package/src/irdevices/waterheaters.ts +26 -26
@@ -118,65 +118,6 @@ export class Plug {
118
118
  });
119
119
  }
120
120
 
121
- config(device: device & devicesConfig) {
122
- const config: any = device.plug;
123
- if (device.ble !== undefined) {
124
- config['ble'] = device.ble;
125
- }
126
- if (device.logging !== undefined) {
127
- config['logging'] = device.logging;
128
- }
129
- if (device.refreshRate !== undefined) {
130
- config['refreshRate'] = device.refreshRate;
131
- }
132
- if (device.scanDuration !== undefined) {
133
- config['scanDuration'] = device.scanDuration;
134
- }
135
- if (config !== undefined) {
136
- this.warnLog(`Plug: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
137
- }
138
- }
139
-
140
- refreshRate(device: device & devicesConfig) {
141
- if (device.refreshRate) {
142
- this.deviceRefreshRate = this.accessory.context.refreshRate = device.refreshRate;
143
- this.debugLog(`Plug: ${this.accessory.displayName} Using Device Config refreshRate: ${this.deviceRefreshRate}`);
144
- } else if (this.platform.config.options!.refreshRate) {
145
- this.deviceRefreshRate = this.accessory.context.refreshRate = this.platform.config.options!.refreshRate;
146
- this.debugLog(`Plug: ${this.accessory.displayName} Using Platform Config refreshRate: ${this.deviceRefreshRate}`);
147
- }
148
- }
149
-
150
- scan(device: device & devicesConfig) {
151
- if (device.scanDuration) {
152
- this.scanDuration = this.accessory.context.scanDuration = device.scanDuration;
153
- if (device.ble) {
154
- this.debugLog(`Plug: ${this.accessory.displayName} Using Device Config scanDuration: ${this.scanDuration}`);
155
- }
156
- } else {
157
- this.scanDuration = this.accessory.context.scanDuration = 1;
158
- if (this.device.ble) {
159
- this.debugLog(`Plug: ${this.accessory.displayName} Using Default scanDuration: ${this.scanDuration}`);
160
- }
161
- }
162
- }
163
-
164
- logs(device: device & devicesConfig) {
165
- if (this.platform.debugMode) {
166
- this.deviceLogging = this.accessory.context.logging = 'debugMode';
167
- this.debugLog(`Plug: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
168
- } else if (device.logging) {
169
- this.deviceLogging = this.accessory.context.logging = device.logging;
170
- this.debugLog(`Plug: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
171
- } else if (this.platform.config.options?.logging) {
172
- this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
173
- this.debugLog(`Plug: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
174
- } else {
175
- this.deviceLogging = this.accessory.context.logging = 'standard';
176
- this.debugLog(`Plug: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
177
- }
178
- }
179
-
180
121
  parseStatus() {
181
122
  switch (this.power) {
182
123
  case 'on':
@@ -308,6 +249,65 @@ export class Plug {
308
249
  this.doPlugUpdate.next();
309
250
  }
310
251
 
252
+ config(device: device & devicesConfig) {
253
+ const config: any = device.plug;
254
+ if (device.ble !== undefined) {
255
+ config['ble'] = device.ble;
256
+ }
257
+ if (device.logging !== undefined) {
258
+ config['logging'] = device.logging;
259
+ }
260
+ if (device.refreshRate !== undefined) {
261
+ config['refreshRate'] = device.refreshRate;
262
+ }
263
+ if (device.scanDuration !== undefined) {
264
+ config['scanDuration'] = device.scanDuration;
265
+ }
266
+ if (config !== undefined) {
267
+ this.warnLog(`Plug: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
268
+ }
269
+ }
270
+
271
+ refreshRate(device: device & devicesConfig) {
272
+ if (device.refreshRate) {
273
+ this.deviceRefreshRate = this.accessory.context.refreshRate = device.refreshRate;
274
+ this.debugLog(`Plug: ${this.accessory.displayName} Using Device Config refreshRate: ${this.deviceRefreshRate}`);
275
+ } else if (this.platform.config.options!.refreshRate) {
276
+ this.deviceRefreshRate = this.accessory.context.refreshRate = this.platform.config.options!.refreshRate;
277
+ this.debugLog(`Plug: ${this.accessory.displayName} Using Platform Config refreshRate: ${this.deviceRefreshRate}`);
278
+ }
279
+ }
280
+
281
+ scan(device: device & devicesConfig) {
282
+ if (device.scanDuration) {
283
+ this.scanDuration = this.accessory.context.scanDuration = device.scanDuration;
284
+ if (device.ble) {
285
+ this.debugLog(`Plug: ${this.accessory.displayName} Using Device Config scanDuration: ${this.scanDuration}`);
286
+ }
287
+ } else {
288
+ this.scanDuration = this.accessory.context.scanDuration = 1;
289
+ if (this.device.ble) {
290
+ this.debugLog(`Plug: ${this.accessory.displayName} Using Default scanDuration: ${this.scanDuration}`);
291
+ }
292
+ }
293
+ }
294
+
295
+ logs(device: device & devicesConfig) {
296
+ if (this.platform.debugMode) {
297
+ this.deviceLogging = this.accessory.context.logging = 'debugMode';
298
+ this.debugLog(`Plug: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
299
+ } else if (device.logging) {
300
+ this.deviceLogging = this.accessory.context.logging = device.logging;
301
+ this.debugLog(`Plug: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
302
+ } else if (this.platform.config.options?.logging) {
303
+ this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
304
+ this.debugLog(`Plug: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
305
+ } else {
306
+ this.deviceLogging = this.accessory.context.logging = 'standard';
307
+ this.debugLog(`Plug: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
308
+ }
309
+ }
310
+
311
311
  /**
312
312
  * Logging for Device
313
313
  */
@@ -167,32 +167,6 @@ export class AirConditioner {
167
167
  .onSet(this.RotationSpeedSet.bind(this));
168
168
  }
169
169
 
170
- config(device: irdevice & irDevicesConfig) {
171
- const config: any = device.irair;
172
- if (device.logging !== undefined) {
173
- config['logging'] = device.logging;
174
- }
175
- if (config !== undefined) {
176
- this.warnLog(`Air Conditioner: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
177
- }
178
- }
179
-
180
- logs(device: irdevice & irDevicesConfig) {
181
- if (this.platform.debugMode) {
182
- this.deviceLogging = this.accessory.context.logging = 'debugMode';
183
- this.debugLog(`Air Conditioner: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
184
- } else if (device.logging) {
185
- this.deviceLogging = this.accessory.context.logging = device.logging;
186
- this.debugLog(`Air Conditioner: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
187
- } else if (this.platform.config.options?.logging) {
188
- this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
189
- this.debugLog(`Air Conditioner: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
190
- } else {
191
- this.deviceLogging = this.accessory.context.logging = 'standard';
192
- this.debugLog(`Air Conditioner: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
193
- }
194
- }
195
-
196
170
  /**
197
171
  * Pushes the requested changes to the SwitchBot API
198
172
  * deviceType commandType Command command parameter Description
@@ -584,6 +558,32 @@ export class AirConditioner {
584
558
  }
585
559
  }
586
560
 
561
+ config(device: irdevice & irDevicesConfig) {
562
+ const config: any = device.irair;
563
+ if (device.logging !== undefined) {
564
+ config['logging'] = device.logging;
565
+ }
566
+ if (config !== undefined) {
567
+ this.warnLog(`Air Conditioner: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
568
+ }
569
+ }
570
+
571
+ logs(device: irdevice & irDevicesConfig) {
572
+ if (this.platform.debugMode) {
573
+ this.deviceLogging = this.accessory.context.logging = 'debugMode';
574
+ this.debugLog(`Air Conditioner: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
575
+ } else if (device.logging) {
576
+ this.deviceLogging = this.accessory.context.logging = device.logging;
577
+ this.debugLog(`Air Conditioner: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
578
+ } else if (this.platform.config.options?.logging) {
579
+ this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
580
+ this.debugLog(`Air Conditioner: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
581
+ } else {
582
+ this.deviceLogging = this.accessory.context.logging = 'standard';
583
+ this.debugLog(`Air Conditioner: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
584
+ }
585
+ }
586
+
587
587
  /**
588
588
  * Logging for Device
589
589
  */
@@ -88,32 +88,6 @@ export class AirPurifier {
88
88
  this.service.getCharacteristic(this.platform.Characteristic.TargetAirPurifierState).onSet(this.TargetAirPurifierStateSet.bind(this));
89
89
  }
90
90
 
91
- config(device: irdevice & irDevicesConfig) {
92
- const config: any = device.irpur;
93
- if (device.logging !== undefined) {
94
- config['logging'] = device.logging;
95
- }
96
- if (config !== undefined) {
97
- this.warnLog(`Air Purifier: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
98
- }
99
- }
100
-
101
- logs(device: irdevice & irDevicesConfig) {
102
- if (this.platform.debugMode) {
103
- this.deviceLogging = this.accessory.context.logging = 'debugMode';
104
- this.debugLog(`Air Purifier: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
105
- } else if (device.logging) {
106
- this.deviceLogging = this.accessory.context.logging = device.logging;
107
- this.debugLog(`Air Purifier: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
108
- } else if (this.platform.config.options?.logging) {
109
- this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
110
- this.debugLog(`Air Purifier: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
111
- } else {
112
- this.deviceLogging = this.accessory.context.logging = 'standard';
113
- this.debugLog(`Air Purifier: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
114
- }
115
- }
116
-
117
91
  private ActiveSet(value: CharacteristicValue) {
118
92
  this.debugLog(`Air Purifier: ${this.accessory.displayName} Set Active: ${value}`);
119
93
  if (value === this.platform.Characteristic.Active.INACTIVE) {
@@ -306,6 +280,32 @@ export class AirPurifier {
306
280
  //throw new this.platform.api.hap.HapStatusError(HAPStatus.SERVICE_COMMUNICATION_FAILURE);
307
281
  }
308
282
 
283
+ config(device: irdevice & irDevicesConfig) {
284
+ const config: any = device.irpur;
285
+ if (device.logging !== undefined) {
286
+ config['logging'] = device.logging;
287
+ }
288
+ if (config !== undefined) {
289
+ this.warnLog(`Air Purifier: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
290
+ }
291
+ }
292
+
293
+ logs(device: irdevice & irDevicesConfig) {
294
+ if (this.platform.debugMode) {
295
+ this.deviceLogging = this.accessory.context.logging = 'debugMode';
296
+ this.debugLog(`Air Purifier: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
297
+ } else if (device.logging) {
298
+ this.deviceLogging = this.accessory.context.logging = device.logging;
299
+ this.debugLog(`Air Purifier: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
300
+ } else if (this.platform.config.options?.logging) {
301
+ this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
302
+ this.debugLog(`Air Purifier: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
303
+ } else {
304
+ this.deviceLogging = this.accessory.context.logging = 'standard';
305
+ this.debugLog(`Air Purifier: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
306
+ }
307
+ }
308
+
309
309
  /**
310
310
  * Logging for Device
311
311
  */
@@ -58,32 +58,6 @@ export class Camera {
58
58
  this.service.getCharacteristic(this.platform.Characteristic.On).onSet(this.OnSet.bind(this));
59
59
  }
60
60
 
61
- config(device: irdevice & irDevicesConfig) {
62
- const config: any = device.ircam;
63
- if (device.logging !== undefined) {
64
- config['logging'] = device.logging;
65
- }
66
- if (config !== undefined) {
67
- this.warnLog(`Camera: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
68
- }
69
- }
70
-
71
- logs(device: irdevice & irDevicesConfig) {
72
- if (this.platform.debugMode) {
73
- this.deviceLogging = this.accessory.context.logging = 'debugMode';
74
- this.debugLog(`Camera: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
75
- } else if (device.logging) {
76
- this.deviceLogging = this.accessory.context.logging = device.logging;
77
- this.debugLog(`Camera: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
78
- } else if (this.platform.config.options?.logging) {
79
- this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
80
- this.debugLog(`Camera: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
81
- } else {
82
- this.deviceLogging = this.accessory.context.logging = 'standard';
83
- this.debugLog(`Camera: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
84
- }
85
- }
86
-
87
61
  private OnSet(value: CharacteristicValue) {
88
62
  this.debugLog(`Camera: ${this.accessory.displayName} On: ${value}`);
89
63
  this.On = value;
@@ -195,6 +169,32 @@ export class Camera {
195
169
  //throw new this.platform.api.hap.HapStatusError(HAPStatus.SERVICE_COMMUNICATION_FAILURE);
196
170
  }
197
171
 
172
+ config(device: irdevice & irDevicesConfig) {
173
+ const config: any = device.ircam;
174
+ if (device.logging !== undefined) {
175
+ config['logging'] = device.logging;
176
+ }
177
+ if (config !== undefined) {
178
+ this.warnLog(`Camera: ${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(`Camera: ${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(`Camera: ${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(`Camera: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
192
+ } else {
193
+ this.deviceLogging = this.accessory.context.logging = 'standard';
194
+ this.debugLog(`Camera: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
195
+ }
196
+ }
197
+
198
198
  /**
199
199
  * Logging for Device
200
200
  */
@@ -117,32 +117,6 @@ export class Fan {
117
117
  }
118
118
  }
119
119
 
120
- config(device: irdevice & irDevicesConfig) {
121
- const config: any = device.irfan;
122
- if (device.logging !== undefined) {
123
- config['logging'] = device.logging;
124
- }
125
- if (config !== undefined) {
126
- this.warnLog(`Fan: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
127
- }
128
- }
129
-
130
- logs(device: irdevice & irDevicesConfig) {
131
- if (this.platform.debugMode) {
132
- this.deviceLogging = this.accessory.context.logging = 'debugMode';
133
- this.debugLog(`Fan: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
134
- } else if (device.logging) {
135
- this.deviceLogging = this.accessory.context.logging = device.logging;
136
- this.debugLog(`Fan: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
137
- } else if (this.platform.config.options?.logging) {
138
- this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
139
- this.debugLog(`Fan: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
140
- } else {
141
- this.deviceLogging = this.accessory.context.logging = 'standard';
142
- this.debugLog(`Fan: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
143
- }
144
- }
145
-
146
120
  private SwingModeSet(value: CharacteristicValue) {
147
121
  this.debugLog(`Fan: ${this.accessory.displayName} SwingMode: ${value}`);
148
122
  if (value > this.SwingMode) {
@@ -319,6 +293,32 @@ export class Fan {
319
293
  //throw new this.platform.api.hap.HapStatusError(HAPStatus.SERVICE_COMMUNICATION_FAILURE);
320
294
  }
321
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
+
322
322
  /**
323
323
  * Logging for Device
324
324
  */
@@ -73,32 +73,6 @@ export class Light {
73
73
  });*/
74
74
  }
75
75
 
76
- config(device: irdevice & irDevicesConfig) {
77
- const config: any = device.irlight;
78
- if (device.logging !== undefined) {
79
- config['logging'] = device.logging;
80
- }
81
- if (config !== undefined) {
82
- this.warnLog(`Light: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
83
- }
84
- }
85
-
86
- logs(device: irdevice & irDevicesConfig) {
87
- if (this.platform.debugMode) {
88
- this.deviceLogging = this.accessory.context.logging = 'debugMode';
89
- this.debugLog(`Light: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
90
- } else if (device.logging) {
91
- this.deviceLogging = this.accessory.context.logging = device.logging;
92
- this.debugLog(`Light: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
93
- } else if (this.platform.config.options?.logging) {
94
- this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
95
- this.debugLog(`Light: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
96
- } else {
97
- this.deviceLogging = this.accessory.context.logging = 'standard';
98
- this.debugLog(`Light: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
99
- }
100
- }
101
-
102
76
  private OnSet(value: CharacteristicValue) {
103
77
  this.debugLog(`Light: ${this.accessory.displayName} On: ${value}`);
104
78
  this.On = value;
@@ -229,6 +203,32 @@ export class Light {
229
203
  //throw new this.platform.api.hap.HapStatusError(HAPStatus.SERVICE_COMMUNICATION_FAILURE);
230
204
  }
231
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
+
232
232
  /**
233
233
  * Logging for Device
234
234
  */
@@ -66,43 +66,6 @@ export class Others {
66
66
  }
67
67
  }
68
68
 
69
- deviceType(device: irdevice & irDevicesConfig) {
70
- if (device.other?.deviceType) {
71
- this.otherDeviceType = this.accessory.context.deviceType = device.other.deviceType;
72
- if (this.deviceLogging === 'debug' || this.deviceLogging === 'standard') {
73
- this.warnLog(`Other: ${this.accessory.displayName} Using Device Type: ${this.otherDeviceType}`);
74
- }
75
- } else {
76
- this.errorLog(`Other: ${this.accessory.displayName} No Device Type Set, deviceType: ${this.device.other?.deviceType}`);
77
- }
78
- }
79
-
80
- config(device: irdevice & irDevicesConfig) {
81
- const config: any = device.other;
82
- if (device.logging !== undefined) {
83
- config['logging'] = device.logging;
84
- }
85
- if (config !== undefined) {
86
- this.warnLog(`Other: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
87
- }
88
- }
89
-
90
- logs(device: irdevice & irDevicesConfig) {
91
- if (this.platform.debugMode) {
92
- this.deviceLogging = this.accessory.context.logging = 'debugMode';
93
- this.debugLog(`Other: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
94
- } else if (device.logging) {
95
- this.deviceLogging = this.accessory.context.logging = device.logging;
96
- this.debugLog(`Other: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
97
- } else if (this.platform.config.options?.logging) {
98
- this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
99
- this.debugLog(`Other: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
100
- } else {
101
- this.deviceLogging = this.accessory.context.logging = 'standard';
102
- this.debugLog(`Other: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
103
- }
104
- }
105
-
106
69
  private ActiveSet(value: CharacteristicValue) {
107
70
  this.debugLog(`Other: ${this.accessory.displayName} On: ${value}`);
108
71
  if (this.Active) {
@@ -238,6 +201,43 @@ export class Others {
238
201
  //throw new this.platform.api.hap.HapStatusError(HAPStatus.SERVICE_COMMUNICATION_FAILURE);
239
202
  }
240
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
+
241
241
  /**
242
242
  * Logging for Device
243
243
  */
@@ -129,32 +129,6 @@ export class TV {
129
129
  .onSet(this.VolumeSelectorSet.bind(this));
130
130
  }
131
131
 
132
- config(device: irdevice & irDevicesConfig) {
133
- const config: any = device.irtv;
134
- if (device.logging !== undefined) {
135
- config['logging'] = device.logging;
136
- }
137
- if (config !== undefined) {
138
- this.warnLog(`${this.device.remoteType}: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
139
- }
140
- }
141
-
142
- logs(device: irdevice & irDevicesConfig) {
143
- if (this.platform.debugMode) {
144
- this.deviceLogging = this.accessory.context.logging = 'debugMode';
145
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
146
- } else if (device.logging) {
147
- this.deviceLogging = this.accessory.context.logging = device.logging;
148
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
149
- } else if (this.platform.config.options?.logging) {
150
- this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
151
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
152
- } else {
153
- this.deviceLogging = this.accessory.context.logging = 'standard';
154
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
155
- }
156
- }
157
-
158
132
  private VolumeSelectorSet(value: CharacteristicValue) {
159
133
  this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} VolumeSelector: ${value}`);
160
134
  if (value === this.platform.Characteristic.VolumeSelector.INCREMENT) {
@@ -435,6 +409,32 @@ export class TV {
435
409
  //throw new this.platform.api.hap.HapStatusError(HAPStatus.SERVICE_COMMUNICATION_FAILURE);
436
410
  }
437
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
+
438
438
  /**
439
439
  * Logging for Device
440
440
  */
@@ -58,32 +58,6 @@ export class VacuumCleaner {
58
58
  this.service.getCharacteristic(this.platform.Characteristic.On).onSet(this.OnSet.bind(this));
59
59
  }
60
60
 
61
- config(device: irdevice & irDevicesConfig) {
62
- const config: any = device.irvc;
63
- if (device.logging !== undefined) {
64
- config['logging'] = device.logging;
65
- }
66
- if (config !== undefined) {
67
- this.warnLog(`Vacuum Cleaner: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
68
- }
69
- }
70
-
71
- logs(device: irdevice & irDevicesConfig) {
72
- if (this.platform.debugMode) {
73
- this.deviceLogging = this.accessory.context.logging = 'debugMode';
74
- this.debugLog(`Vacuum Cleaner: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
75
- } else if (device.logging) {
76
- this.deviceLogging = this.accessory.context.logging = device.logging;
77
- this.debugLog(`Vacuum Cleaner: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
78
- } else if (this.platform.config.options?.logging) {
79
- this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
80
- this.debugLog(`Vacuum Cleaner: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
81
- } else {
82
- this.deviceLogging = this.accessory.context.logging = 'standard';
83
- this.debugLog(`Vacuum Cleaner: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
84
- }
85
- }
86
-
87
61
  private OnSet(value: CharacteristicValue) {
88
62
  this.debugLog(`Vacuum Cleaner: ${this.accessory.displayName} On: ${value}`);
89
63
  this.On = value;
@@ -195,6 +169,32 @@ export class VacuumCleaner {
195
169
  //throw new this.platform.api.hap.HapStatusError(HAPStatus.SERVICE_COMMUNICATION_FAILURE);
196
170
  }
197
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
+
198
198
  /**
199
199
  * Logging for Device
200
200
  */