@switchbot/homebridge-switchbot 2.0.0-beta.4 → 2.0.0-beta.41

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 (119) hide show
  1. package/CHANGELOG.md +12 -2
  2. package/README.md +3 -2
  3. package/config.schema.json +108 -20
  4. package/dist/device/bot.d.ts +34 -28
  5. package/dist/device/bot.d.ts.map +1 -1
  6. package/dist/device/bot.js +657 -648
  7. package/dist/device/bot.js.map +1 -1
  8. package/dist/device/ceilinglight.d.ts +137 -0
  9. package/dist/device/ceilinglight.d.ts.map +1 -0
  10. package/dist/device/ceilinglight.js +1127 -0
  11. package/dist/device/ceilinglight.js.map +1 -0
  12. package/dist/device/colorbulb.d.ts +36 -19
  13. package/dist/device/colorbulb.d.ts.map +1 -1
  14. package/dist/device/colorbulb.js +486 -309
  15. package/dist/device/colorbulb.js.map +1 -1
  16. package/dist/device/contact.d.ts +18 -8
  17. package/dist/device/contact.d.ts.map +1 -1
  18. package/dist/device/contact.js +306 -237
  19. package/dist/device/contact.js.map +1 -1
  20. package/dist/device/curtain.d.ts +23 -16
  21. package/dist/device/curtain.d.ts.map +1 -1
  22. package/dist/device/curtain.js +566 -502
  23. package/dist/device/curtain.js.map +1 -1
  24. package/dist/device/humidifier.d.ts +24 -18
  25. package/dist/device/humidifier.d.ts.map +1 -1
  26. package/dist/device/humidifier.js +453 -369
  27. package/dist/device/humidifier.js.map +1 -1
  28. package/dist/device/lock.d.ts +27 -8
  29. package/dist/device/lock.d.ts.map +1 -1
  30. package/dist/device/lock.js +305 -148
  31. package/dist/device/lock.js.map +1 -1
  32. package/dist/device/meter.d.ts +22 -16
  33. package/dist/device/meter.d.ts.map +1 -1
  34. package/dist/device/meter.js +367 -267
  35. package/dist/device/meter.js.map +1 -1
  36. package/dist/device/meterplus.d.ts +24 -12
  37. package/dist/device/meterplus.d.ts.map +1 -1
  38. package/dist/device/meterplus.js +381 -213
  39. package/dist/device/meterplus.js.map +1 -1
  40. package/dist/device/motion.d.ts +18 -8
  41. package/dist/device/motion.d.ts.map +1 -1
  42. package/dist/device/motion.js +279 -216
  43. package/dist/device/motion.js.map +1 -1
  44. package/dist/device/plug.d.ts +27 -17
  45. package/dist/device/plug.d.ts.map +1 -1
  46. package/dist/device/plug.js +295 -251
  47. package/dist/device/plug.js.map +1 -1
  48. package/dist/device/striplight.d.ts +43 -19
  49. package/dist/device/striplight.d.ts.map +1 -1
  50. package/dist/device/striplight.js +506 -262
  51. package/dist/device/striplight.js.map +1 -1
  52. package/dist/irdevice/airconditioner.d.ts +9 -12
  53. package/dist/irdevice/airconditioner.d.ts.map +1 -1
  54. package/dist/irdevice/airconditioner.js +278 -230
  55. package/dist/irdevice/airconditioner.js.map +1 -1
  56. package/dist/irdevice/airpurifier.d.ts +5 -3
  57. package/dist/irdevice/airpurifier.d.ts.map +1 -1
  58. package/dist/irdevice/airpurifier.js +154 -104
  59. package/dist/irdevice/airpurifier.js.map +1 -1
  60. package/dist/irdevice/camera.d.ts +11 -8
  61. package/dist/irdevice/camera.d.ts.map +1 -1
  62. package/dist/irdevice/camera.js +133 -86
  63. package/dist/irdevice/camera.js.map +1 -1
  64. package/dist/irdevice/fan.d.ts +10 -7
  65. package/dist/irdevice/fan.d.ts.map +1 -1
  66. package/dist/irdevice/fan.js +160 -109
  67. package/dist/irdevice/fan.js.map +1 -1
  68. package/dist/irdevice/light.d.ts +11 -8
  69. package/dist/irdevice/light.d.ts.map +1 -1
  70. package/dist/irdevice/light.js +137 -103
  71. package/dist/irdevice/light.js.map +1 -1
  72. package/dist/irdevice/other.d.ts +11 -8
  73. package/dist/irdevice/other.d.ts.map +1 -1
  74. package/dist/irdevice/other.js +145 -98
  75. package/dist/irdevice/other.js.map +1 -1
  76. package/dist/irdevice/tv.d.ts +12 -9
  77. package/dist/irdevice/tv.d.ts.map +1 -1
  78. package/dist/irdevice/tv.js +143 -93
  79. package/dist/irdevice/tv.js.map +1 -1
  80. package/dist/irdevice/vacuumcleaner.d.ts +9 -10
  81. package/dist/irdevice/vacuumcleaner.d.ts.map +1 -1
  82. package/dist/irdevice/vacuumcleaner.js +132 -89
  83. package/dist/irdevice/vacuumcleaner.js.map +1 -1
  84. package/dist/irdevice/waterheater.d.ts +8 -9
  85. package/dist/irdevice/waterheater.d.ts.map +1 -1
  86. package/dist/irdevice/waterheater.js +132 -89
  87. package/dist/irdevice/waterheater.js.map +1 -1
  88. package/dist/platform.d.ts +15 -12
  89. package/dist/platform.d.ts.map +1 -1
  90. package/dist/platform.js +574 -454
  91. package/dist/platform.js.map +1 -1
  92. package/dist/settings.d.ts +21 -11
  93. package/dist/settings.d.ts.map +1 -1
  94. package/dist/settings.js.map +1 -1
  95. package/homebridge-ui/public/index.html +1 -0
  96. package/package.json +13 -11
  97. package/src/device/bot.ts +656 -659
  98. package/src/device/ceilinglight.ts +1208 -0
  99. package/src/device/colorbulb.ts +490 -344
  100. package/src/device/contact.ts +309 -241
  101. package/src/device/curtain.ts +571 -516
  102. package/src/device/humidifier.ts +456 -403
  103. package/src/device/lock.ts +314 -149
  104. package/src/device/meter.ts +378 -280
  105. package/src/device/meterplus.ts +391 -219
  106. package/src/device/motion.ts +285 -222
  107. package/src/device/plug.ts +299 -260
  108. package/src/device/striplight.ts +522 -289
  109. package/src/irdevice/airconditioner.ts +282 -241
  110. package/src/irdevice/airpurifier.ts +151 -103
  111. package/src/irdevice/camera.ts +131 -85
  112. package/src/irdevice/fan.ts +157 -106
  113. package/src/irdevice/light.ts +135 -103
  114. package/src/irdevice/other.ts +143 -97
  115. package/src/irdevice/tv.ts +142 -93
  116. package/src/irdevice/vacuumcleaner.ts +131 -89
  117. package/src/irdevice/waterheater.ts +130 -89
  118. package/src/platform.ts +567 -476
  119. package/src/settings.ts +22 -11
@@ -1,6 +1,7 @@
1
1
  import https from 'https';
2
2
  import crypto from 'crypto';
3
3
  import { IncomingMessage } from 'http';
4
+ import superStringify from 'super-stringify';
4
5
  import { SwitchBotPlatform } from '../platform';
5
6
  import { CharacteristicValue, PlatformAccessory, Service } from 'homebridge';
6
7
  import { irdevice, irDevicesConfig, HostDomain, DevicePath } from '../settings';
@@ -17,7 +18,6 @@ export class TV {
17
18
 
18
19
  // Characteristic Values
19
20
  Active!: CharacteristicValue;
20
- ActiveCached!: CharacteristicValue;
21
21
  ActiveIdentifier!: CharacteristicValue;
22
22
 
23
23
  // Others
@@ -30,11 +30,7 @@ export class TV {
30
30
  // default placeholders
31
31
  this.logs(device);
32
32
  this.config(device);
33
- if (this.Active === undefined) {
34
- this.Active = this.platform.Characteristic.Active.INACTIVE;
35
- } else {
36
- this.Active = this.accessory.context.Active;
37
- }
33
+ this.context();
38
34
 
39
35
  // set accessory information
40
36
  accessory
@@ -42,7 +38,10 @@ export class TV {
42
38
  .setCharacteristic(this.platform.Characteristic.Name, `${device.deviceName} ${device.remoteType}`)
43
39
  .setCharacteristic(this.platform.Characteristic.Manufacturer, 'SwitchBot')
44
40
  .setCharacteristic(this.platform.Characteristic.Model, device.remoteType)
45
- .setCharacteristic(this.platform.Characteristic.SerialNumber, device.deviceId!);
41
+ .setCharacteristic(this.platform.Characteristic.SerialNumber, device.deviceId!)
42
+ .setCharacteristic(this.platform.Characteristic.FirmwareRevision, this.FirmwareRevision(accessory, device))
43
+ .getCharacteristic(this.platform.Characteristic.FirmwareRevision)
44
+ .updateValue(this.FirmwareRevision(accessory, device));
46
45
 
47
46
  // set the accessory category
48
47
  switch (device.remoteType) {
@@ -194,50 +193,35 @@ export class TV {
194
193
  async ActiveIdentifierSet(value: CharacteristicValue): Promise<void> {
195
194
  this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} ActiveIdentifier: ${value}`);
196
195
  this.ActiveIdentifier = value;
196
+ this.accessory.context.ActiveIdentifier = this.ActiveIdentifier;
197
197
  }
198
198
 
199
199
  async ActiveSet(value: CharacteristicValue): Promise<void> {
200
200
  this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Active: ${value}`);
201
+ this.Active = value;
202
+ this.accessory.context.Active = this.Active;
201
203
  if (!this.device.irtv?.disable_power) {
202
204
  if (value === this.platform.Characteristic.Active.INACTIVE) {
203
205
  await this.pushTvOffChanges();
204
206
  } else {
205
207
  await this.pushTvOnChanges();
206
208
  }
207
- this.Active = value;
208
- this.ActiveCached = this.Active;
209
- this.accessory.context.Active = this.ActiveCached;
210
- }
211
- }
212
-
213
- async updateHomeKitCharacteristics(): Promise<void> {
214
- if (this.Active === undefined) {
215
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Active: ${this.Active}`);
216
- } else {
217
- this.tvService?.updateCharacteristic(this.platform.Characteristic.Active, this.Active);
218
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} updateCharacteristic Active: ${this.Active}`);
219
- }
220
- if (this.ActiveIdentifier === undefined) {
221
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} ActiveIdentifier: ${this.ActiveIdentifier}`);
222
- } else {
223
- this.tvService?.updateCharacteristic(this.platform.Characteristic.ActiveIdentifier, this.ActiveIdentifier);
224
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName}` + ` updateCharacteristic ActiveIdentifier: ${this.ActiveIdentifier}`);
225
209
  }
226
210
  }
227
211
 
228
212
  /**
229
213
  * Pushes the requested changes to the SwitchBot API
230
- * deviceType commandType Command command parameter Description
231
- * TV: "command" "turnOff" "default" = set to OFF state
232
- * TV: "command" "turnOn" "default" = set to ON state
233
- * TV: "command" "volumeAdd" "default" = volume up
234
- * TV: "command" "volumeSub" "default" = volume down
235
- * TV: "command" "channelAdd" "default" = next channel
236
- * TV: "command" "channelSub" "default" = previous channel
214
+ * deviceType commandType Command Parameter Description
215
+ * TV "command" "turnOff" "default" set to OFF state
216
+ * TV "command" "turnOn" "default" set to ON state
217
+ * TV "command" "volumeAdd" "default" volume up
218
+ * TV "command" "volumeSub" "default" volume down
219
+ * TV "command" "channelAdd" "default" next channel
220
+ * TV "command" "channelSub" "default" previous channel
237
221
  */
238
222
  async pushTvOnChanges(): Promise<void> {
239
223
  if (this.Active !== 1) {
240
- const body = JSON.stringify({
224
+ const body = superStringify({
241
225
  'command': 'turnOn',
242
226
  'parameter': 'default',
243
227
  'commandType': 'command',
@@ -247,7 +231,7 @@ export class TV {
247
231
  }
248
232
 
249
233
  async pushTvOffChanges(): Promise<void> {
250
- const body = JSON.stringify({
234
+ const body = superStringify({
251
235
  'command': 'turnOff',
252
236
  'parameter': 'default',
253
237
  'commandType': 'command',
@@ -256,7 +240,7 @@ export class TV {
256
240
  }
257
241
 
258
242
  async pushOkChanges(): Promise<void> {
259
- const body = JSON.stringify({
243
+ const body = superStringify({
260
244
  'command': 'Ok',
261
245
  'parameter': 'default',
262
246
  'commandType': 'command',
@@ -265,7 +249,7 @@ export class TV {
265
249
  }
266
250
 
267
251
  async pushBackChanges(): Promise<void> {
268
- const body = JSON.stringify({
252
+ const body = superStringify({
269
253
  'command': 'Back',
270
254
  'parameter': 'default',
271
255
  'commandType': 'command',
@@ -274,7 +258,7 @@ export class TV {
274
258
  }
275
259
 
276
260
  async pushMenuChanges(): Promise<void> {
277
- const body = JSON.stringify({
261
+ const body = superStringify({
278
262
  'command': 'Menu',
279
263
  'parameter': 'default',
280
264
  'commandType': 'command',
@@ -283,7 +267,7 @@ export class TV {
283
267
  }
284
268
 
285
269
  async pushUpChanges(): Promise<void> {
286
- const body = JSON.stringify({
270
+ const body = superStringify({
287
271
  'command': 'Up',
288
272
  'parameter': 'default',
289
273
  'commandType': 'command',
@@ -292,7 +276,7 @@ export class TV {
292
276
  }
293
277
 
294
278
  async pushDownChanges(): Promise<void> {
295
- const body = JSON.stringify({
279
+ const body = superStringify({
296
280
  'command': 'Down',
297
281
  'parameter': 'default',
298
282
  'commandType': 'command',
@@ -301,7 +285,7 @@ export class TV {
301
285
  }
302
286
 
303
287
  async pushRightChanges(): Promise<void> {
304
- const body = JSON.stringify({
288
+ const body = superStringify({
305
289
  'command': 'Right',
306
290
  'parameter': 'default',
307
291
  'commandType': 'command',
@@ -310,7 +294,7 @@ export class TV {
310
294
  }
311
295
 
312
296
  async pushLeftChanges(): Promise<void> {
313
- const body = JSON.stringify({
297
+ const body = superStringify({
314
298
  'command': 'Left',
315
299
  'parameter': 'default',
316
300
  'commandType': 'command',
@@ -319,7 +303,7 @@ export class TV {
319
303
  }
320
304
 
321
305
  async pushVolumeUpChanges(): Promise<void> {
322
- const body = JSON.stringify({
306
+ const body = superStringify({
323
307
  'command': 'volumeAdd',
324
308
  'parameter': 'default',
325
309
  'commandType': 'command',
@@ -328,7 +312,7 @@ export class TV {
328
312
  }
329
313
 
330
314
  async pushVolumeDownChanges(): Promise<void> {
331
- const body = JSON.stringify({
315
+ const body = superStringify({
332
316
  'command': 'volumeSub',
333
317
  'parameter': 'default',
334
318
  'commandType': 'command',
@@ -337,54 +321,74 @@ export class TV {
337
321
  }
338
322
 
339
323
  async pushTVChanges(body): Promise<void> {
340
- try {
341
- // Make Push On request to the API
342
- const t = Date.now();
343
- const nonce = 'requestID';
344
- const data = this.platform.config.credentials?.token + t + nonce;
345
- const signTerm = crypto.createHmac('sha256', this.platform.config.credentials?.secret)
346
- .update(Buffer.from(data, 'utf-8'))
347
- .digest();
348
- const sign = signTerm.toString('base64');
349
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} sign: ${sign}`);
350
- this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Sending request to SwitchBot API. body: ${body},`);
351
- const options = {
352
- hostname: HostDomain,
353
- port: 443,
354
- path: `${DevicePath}/${this.device.deviceId}/commands`,
355
- method: 'POST',
356
- headers: {
357
- 'Authorization': this.platform.config.credentials?.token,
358
- 'sign': sign,
359
- 'nonce': nonce,
360
- 't': t,
361
- 'Content-Type': 'application/json',
362
- 'Content-Length': body.length,
363
- },
364
- };
365
- const req = https.request(options, res => {
366
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} statusCode: ${res.statusCode}`);
367
- this.statusCode({ res });
368
- res.on('data', d => {
369
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} d: ${d}`);
370
- });
371
- });
372
- req.on('error', (e: any) => {
373
- this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} error message: ${e.message}`);
374
- });
375
- req.write(body);
376
- req.end();
377
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushchanges: ${JSON.stringify(req)}`);
378
- this.updateHomeKitCharacteristics();
379
- } catch (e: any) {
380
- this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} failed pushChanges with OpenAPI Connection`);
381
- if (this.deviceLogging.includes('debug')) {
382
- this.errorLog(
383
- `${this.device.remoteType}: ${this.accessory.displayName} failed pushChanges with OpenAPI Connection,` +
384
- ` Error Message: ${JSON.stringify(e.message)}`,
385
- );
324
+ if (this.device.connectionType === 'OpenAPI') {
325
+ {
326
+ try {
327
+ // Make Push On request to the API
328
+ const t = Date.now();
329
+ const nonce = 'requestID';
330
+ const data = this.platform.config.credentials?.token + t + nonce;
331
+ const signTerm = crypto.createHmac('sha256', this.platform.config.credentials?.secret)
332
+ .update(Buffer.from(data, 'utf-8'))
333
+ .digest();
334
+ const sign = signTerm.toString('base64');
335
+ this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} sign: ${sign}`);
336
+ this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Sending request to SwitchBot API. body: ${body},`);
337
+ const options = {
338
+ hostname: HostDomain,
339
+ port: 443,
340
+ path: `${DevicePath}/${this.device.deviceId}/commands`,
341
+ method: 'POST',
342
+ headers: {
343
+ 'Authorization': this.platform.config.credentials?.token,
344
+ 'sign': sign,
345
+ 'nonce': nonce,
346
+ 't': t,
347
+ 'Content-Type': 'application/json',
348
+ 'Content-Length': body.length,
349
+ },
350
+ };
351
+ const req = https.request(options, res => {
352
+ this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushchanges statusCode: ${res.statusCode}`);
353
+ this.statusCode({ res });
354
+ res.on('data', d => {
355
+ this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} d: ${d}`);
356
+ });
357
+ });
358
+ req.on('error', (e: any) => {
359
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} error message: ${e.message}`);
360
+ });
361
+ req.write(body);
362
+ req.end();
363
+ this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushchanges: ${superStringify(req)}`);
364
+ this.updateHomeKitCharacteristics();
365
+ } catch (e: any) {
366
+ this.apiError(e);
367
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} failed pushChanges with ${this.device.connectionType} Connection,`
368
+ + ` Error Message: ${superStringify(e.message)}`,
369
+ );
370
+ }
386
371
  }
387
- this.apiError(e);
372
+ } else {
373
+ this.warnLog(`${this.device.remoteType}: ${this.accessory.displayName}`
374
+ + ` Connection Type: ${this.device.connectionType}, commands will not be sent to OpenAPI`);
375
+ }
376
+ }
377
+
378
+ async updateHomeKitCharacteristics(): Promise<void> {
379
+ if (this.Active === undefined) {
380
+ this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Active: ${this.Active}`);
381
+ } else {
382
+ this.accessory.context.Active = this.Active;
383
+ this.tvService?.updateCharacteristic(this.platform.Characteristic.Active, this.Active);
384
+ this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} updateCharacteristic Active: ${this.Active}`);
385
+ }
386
+ if (this.ActiveIdentifier === undefined) {
387
+ this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} ActiveIdentifier: ${this.ActiveIdentifier}`);
388
+ } else {
389
+ this.accessory.context.ActiveIdentifier = this.ActiveIdentifier;
390
+ this.tvService?.updateCharacteristic(this.platform.Characteristic.ActiveIdentifier, this.ActiveIdentifier);
391
+ this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName}` + ` updateCharacteristic ActiveIdentifier: ${this.ActiveIdentifier}`);
388
392
  }
389
393
  }
390
394
 
@@ -409,7 +413,7 @@ export class TV {
409
413
  this.errorLog(
410
414
  `${this.device.remoteType}: ` +
411
415
  `${this.accessory.displayName} Device internal error due to device states not synchronized with server,` +
412
- ` Or command: ${JSON.stringify(res)} format is invalid`,
416
+ ` Or command: ${superStringify(res)} format is invalid`,
413
417
  );
414
418
  break;
415
419
  case 100:
@@ -423,7 +427,30 @@ export class TV {
423
427
  async apiError(e: any): Promise<void> {
424
428
  this.tvService.updateCharacteristic(this.platform.Characteristic.Active, e);
425
429
  this.tvService.updateCharacteristic(this.platform.Characteristic.ActiveIdentifier, e);
426
- //throw new this.platform.api.hap.HapStatusError(HAPStatus.SERVICE_COMMUNICATION_FAILURE);
430
+ }
431
+
432
+ FirmwareRevision(accessory: PlatformAccessory, device: irdevice & irDevicesConfig): string {
433
+ let FirmwareRevision: string;
434
+ this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName}`
435
+ + ` accessory.context.FirmwareRevision: ${accessory.context.FirmwareRevision}`);
436
+ this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
437
+ this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
438
+ if (accessory.context.FirmwareRevision) {
439
+ FirmwareRevision = accessory.context.FirmwareRevision;
440
+ } else if (device.firmware) {
441
+ FirmwareRevision = device.firmware;
442
+ } else {
443
+ FirmwareRevision = this.platform.version;
444
+ }
445
+ return FirmwareRevision;
446
+ }
447
+
448
+ async context() {
449
+ if (this.Active === undefined) {
450
+ this.Active = this.platform.Characteristic.Active.INACTIVE;
451
+ } else {
452
+ this.Active = this.accessory.context.Active;
453
+ }
427
454
  }
428
455
 
429
456
  async config(device: irdevice & irDevicesConfig): Promise<void> {
@@ -434,8 +461,14 @@ export class TV {
434
461
  if (device.logging !== undefined) {
435
462
  config['logging'] = device.logging;
436
463
  }
464
+ if (device.connectionType !== undefined) {
465
+ config['connectionType'] = device.connectionType;
466
+ }
467
+ if (device.external !== undefined) {
468
+ config['external'] = device.external;
469
+ }
437
470
  if (Object.entries(config).length !== 0) {
438
- this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
471
+ this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Config: ${superStringify(config)}`);
439
472
  }
440
473
  }
441
474
 
@@ -470,12 +503,28 @@ export class TV {
470
503
  }
471
504
  }
472
505
 
506
+ debugWarnLog(...log: any[]): void {
507
+ if (this.enablingDeviceLogging()) {
508
+ if (this.deviceLogging?.includes('debug')) {
509
+ this.platform.log.warn('[DEBUG]', String(...log));
510
+ }
511
+ }
512
+ }
513
+
473
514
  errorLog(...log: any[]): void {
474
515
  if (this.enablingDeviceLogging()) {
475
516
  this.platform.log.error(String(...log));
476
517
  }
477
518
  }
478
519
 
520
+ debugErrorLog(...log: any[]): void {
521
+ if (this.enablingDeviceLogging()) {
522
+ if (this.deviceLogging?.includes('debug')) {
523
+ this.platform.log.error('[DEBUG]', String(...log));
524
+ }
525
+ }
526
+ }
527
+
479
528
  debugLog(...log: any[]): void {
480
529
  if (this.enablingDeviceLogging()) {
481
530
  if (this.deviceLogging === 'debug') {