@switchbot/homebridge-switchbot 2.8.1-beta.17 → 2.8.1-beta.18

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 (104) hide show
  1. package/dist/device/blindtilt.d.ts.map +1 -1
  2. package/dist/device/blindtilt.js +36 -15
  3. package/dist/device/blindtilt.js.map +1 -1
  4. package/dist/device/bot.js +9 -9
  5. package/dist/device/bot.js.map +1 -1
  6. package/dist/device/ceilinglight.d.ts.map +1 -1
  7. package/dist/device/ceilinglight.js +77 -23
  8. package/dist/device/ceilinglight.js.map +1 -1
  9. package/dist/device/colorbulb.d.ts.map +1 -1
  10. package/dist/device/colorbulb.js +35 -4
  11. package/dist/device/colorbulb.js.map +1 -1
  12. package/dist/device/contact.d.ts.map +1 -1
  13. package/dist/device/contact.js +21 -11
  14. package/dist/device/contact.js.map +1 -1
  15. package/dist/device/curtain.d.ts.map +1 -1
  16. package/dist/device/curtain.js +35 -14
  17. package/dist/device/curtain.js.map +1 -1
  18. package/dist/device/hub.d.ts.map +1 -1
  19. package/dist/device/hub.js +20 -10
  20. package/dist/device/hub.js.map +1 -1
  21. package/dist/device/humidifier.d.ts.map +1 -1
  22. package/dist/device/humidifier.js +65 -22
  23. package/dist/device/humidifier.js.map +1 -1
  24. package/dist/device/iosensor.d.ts.map +1 -1
  25. package/dist/device/iosensor.js +20 -10
  26. package/dist/device/iosensor.js.map +1 -1
  27. package/dist/device/lightstrip.d.ts.map +1 -1
  28. package/dist/device/lightstrip.js +62 -19
  29. package/dist/device/lightstrip.js.map +1 -1
  30. package/dist/device/lock.d.ts.map +1 -1
  31. package/dist/device/lock.js +34 -13
  32. package/dist/device/lock.js.map +1 -1
  33. package/dist/device/meter.d.ts.map +1 -1
  34. package/dist/device/meter.js +20 -10
  35. package/dist/device/meter.js.map +1 -1
  36. package/dist/device/meterplus.d.ts.map +1 -1
  37. package/dist/device/meterplus.js +20 -10
  38. package/dist/device/meterplus.js.map +1 -1
  39. package/dist/device/motion.d.ts.map +1 -1
  40. package/dist/device/motion.js +20 -10
  41. package/dist/device/motion.js.map +1 -1
  42. package/dist/device/plug.d.ts.map +1 -1
  43. package/dist/device/plug.js +31 -10
  44. package/dist/device/plug.js.map +1 -1
  45. package/dist/device/robotvacuumcleaner.d.ts.map +1 -1
  46. package/dist/device/robotvacuumcleaner.js +47 -15
  47. package/dist/device/robotvacuumcleaner.js.map +1 -1
  48. package/dist/irdevice/airconditioner.d.ts.map +1 -1
  49. package/dist/irdevice/airconditioner.js +15 -4
  50. package/dist/irdevice/airconditioner.js.map +1 -1
  51. package/dist/irdevice/airpurifier.d.ts.map +1 -1
  52. package/dist/irdevice/airpurifier.js +15 -4
  53. package/dist/irdevice/airpurifier.js.map +1 -1
  54. package/dist/irdevice/camera.d.ts.map +1 -1
  55. package/dist/irdevice/camera.js +15 -4
  56. package/dist/irdevice/camera.js.map +1 -1
  57. package/dist/irdevice/fan.d.ts.map +1 -1
  58. package/dist/irdevice/fan.js +15 -4
  59. package/dist/irdevice/fan.js.map +1 -1
  60. package/dist/irdevice/light.d.ts.map +1 -1
  61. package/dist/irdevice/light.js +16 -5
  62. package/dist/irdevice/light.js.map +1 -1
  63. package/dist/irdevice/other.d.ts.map +1 -1
  64. package/dist/irdevice/other.js +15 -4
  65. package/dist/irdevice/other.js.map +1 -1
  66. package/dist/irdevice/tv.d.ts.map +1 -1
  67. package/dist/irdevice/tv.js +15 -4
  68. package/dist/irdevice/tv.js.map +1 -1
  69. package/dist/irdevice/vacuumcleaner.d.ts.map +1 -1
  70. package/dist/irdevice/vacuumcleaner.js +15 -4
  71. package/dist/irdevice/vacuumcleaner.js.map +1 -1
  72. package/dist/irdevice/waterheater.d.ts.map +1 -1
  73. package/dist/irdevice/waterheater.js +15 -4
  74. package/dist/irdevice/waterheater.js.map +1 -1
  75. package/dist/platform.d.ts.map +1 -1
  76. package/dist/platform.js +18 -3
  77. package/dist/platform.js.map +1 -1
  78. package/package.json +1 -1
  79. package/src/device/blindtilt.ts +34 -15
  80. package/src/device/bot.ts +10 -10
  81. package/src/device/ceilinglight.ts +72 -23
  82. package/src/device/colorbulb.ts +31 -4
  83. package/src/device/contact.ts +20 -11
  84. package/src/device/curtain.ts +33 -14
  85. package/src/device/hub.ts +19 -10
  86. package/src/device/humidifier.ts +61 -22
  87. package/src/device/iosensor.ts +19 -10
  88. package/src/device/lightstrip.ts +58 -19
  89. package/src/device/lock.ts +32 -13
  90. package/src/device/meter.ts +19 -10
  91. package/src/device/meterplus.ts +19 -10
  92. package/src/device/motion.ts +19 -10
  93. package/src/device/plug.ts +29 -10
  94. package/src/device/robotvacuumcleaner.ts +44 -15
  95. package/src/irdevice/airconditioner.ts +14 -4
  96. package/src/irdevice/airpurifier.ts +14 -4
  97. package/src/irdevice/camera.ts +14 -4
  98. package/src/irdevice/fan.ts +14 -4
  99. package/src/irdevice/light.ts +15 -5
  100. package/src/irdevice/other.ts +14 -4
  101. package/src/irdevice/tv.ts +14 -4
  102. package/src/irdevice/vacuumcleaner.ts +14 -4
  103. package/src/irdevice/waterheater.ts +14 -4
  104. package/src/platform.ts +15 -3
@@ -369,17 +369,26 @@ export class StripLight {
369
369
  const { body, statusCode, headers } = await request(`${Devices}/${this.device.deviceId}/status`, {
370
370
  headers: this.platform.generateHeaders(),
371
371
  });
372
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
373
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
374
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
372
375
  const deviceStatus: any = await body.json();
373
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Devices: ${JSON.stringify(deviceStatus.body)}`);
374
- this.statusCode(statusCode);
375
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Headers: ${JSON.stringify(headers)}`);
376
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} refreshStatus: ${JSON.stringify(deviceStatus)}`);
377
- this.OpenAPI_On = deviceStatus.body.power;
378
- this.OpenAPI_RGB = deviceStatus.body.color;
379
- this.OpenAPI_Brightness = deviceStatus.body.brightness;
380
- this.OpenAPI_FirmwareRevision = deviceStatus.body.version;
381
- this.openAPIparseStatus();
382
- this.updateHomeKitCharacteristics();
376
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
377
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
378
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
379
+ if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
380
+ this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
381
+ + `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
382
+ this.OpenAPI_On = deviceStatus.body.power;
383
+ this.OpenAPI_RGB = deviceStatus.body.color;
384
+ this.OpenAPI_Brightness = deviceStatus.body.brightness;
385
+ this.OpenAPI_FirmwareRevision = deviceStatus.body.version;
386
+ this.openAPIparseStatus();
387
+ this.updateHomeKitCharacteristics();
388
+ } else {
389
+ this.statusCode(statusCode);
390
+ this.statusCode(deviceStatus.statusCode);
391
+ }
383
392
  } catch (e: any) {
384
393
  this.apiError(e);
385
394
  this.errorLog(
@@ -583,10 +592,20 @@ export class StripLight {
583
592
  method: 'POST',
584
593
  headers: this.platform.generateHeaders(),
585
594
  });
595
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
596
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
597
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
586
598
  const deviceStatus: any = await body.json();
587
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Devices: ${JSON.stringify(deviceStatus.body)}`);
588
- this.statusCode(statusCode);
589
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Headers: ${JSON.stringify(headers)}`);
599
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
600
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
601
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
602
+ if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
603
+ this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
604
+ + `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
605
+ } else {
606
+ this.statusCode(statusCode);
607
+ this.statusCode(deviceStatus.statusCode);
608
+ }
590
609
  } catch (e: any) {
591
610
  this.apiError(e);
592
611
  this.errorLog(
@@ -631,10 +650,20 @@ export class StripLight {
631
650
  method: 'POST',
632
651
  headers: this.platform.generateHeaders(),
633
652
  });
653
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
654
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
655
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
634
656
  const deviceStatus: any = await body.json();
635
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Devices: ${JSON.stringify(deviceStatus.body)}`);
636
- this.statusCode(statusCode);
637
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Headers: ${JSON.stringify(headers)}`);
657
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
658
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
659
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
660
+ if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
661
+ this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
662
+ + `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
663
+ } else {
664
+ this.statusCode(statusCode);
665
+ this.statusCode(deviceStatus.statusCode);
666
+ }
638
667
  } catch (e: any) {
639
668
  this.apiError(e);
640
669
  this.errorLog(
@@ -665,10 +694,20 @@ export class StripLight {
665
694
  method: 'POST',
666
695
  headers: this.platform.generateHeaders(),
667
696
  });
697
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
698
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
699
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
668
700
  const deviceStatus: any = await body.json();
669
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Devices: ${JSON.stringify(deviceStatus.body)}`);
670
- this.statusCode(statusCode);
671
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Headers: ${JSON.stringify(headers)}`);
701
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
702
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
703
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
704
+ if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
705
+ this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
706
+ + `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
707
+ } else {
708
+ this.statusCode(statusCode);
709
+ this.statusCode(deviceStatus.statusCode);
710
+ }
672
711
  } catch (e: any) {
673
712
  this.apiError(e);
674
713
  this.errorLog(
@@ -333,17 +333,26 @@ export class Lock {
333
333
  const { body, statusCode, headers } = await request(`${Devices}/${this.device.deviceId}/status`, {
334
334
  headers: this.platform.generateHeaders(),
335
335
  });
336
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
337
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
338
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
336
339
  const deviceStatus: any = await body.json();
337
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Devices: ${JSON.stringify(deviceStatus.body)}`);
338
- this.statusCode(statusCode);
339
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Headers: ${JSON.stringify(headers)}`);
340
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} refreshStatus: ${JSON.stringify(deviceStatus)}`);
341
- this.OpenAPI_LockCurrentState = deviceStatus.body.lockState;
342
- this.OpenAPI_ContactSensorState = deviceStatus.body.doorState;
343
- this.OpenAPI_BatteryLevel = deviceStatus.body.battery;
344
- this.OpenAPI_FirmwareRevision = deviceStatus.body.version;
345
- this.openAPIparseStatus();
346
- this.updateHomeKitCharacteristics();
340
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
341
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
342
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
343
+ if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
344
+ this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
345
+ + `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
346
+ this.OpenAPI_LockCurrentState = deviceStatus.body.lockState;
347
+ this.OpenAPI_ContactSensorState = deviceStatus.body.doorState;
348
+ this.OpenAPI_BatteryLevel = deviceStatus.body.battery;
349
+ this.OpenAPI_FirmwareRevision = deviceStatus.body.version;
350
+ this.openAPIparseStatus();
351
+ this.updateHomeKitCharacteristics();
352
+ } else {
353
+ this.statusCode(statusCode);
354
+ this.statusCode(deviceStatus.statusCode);
355
+ }
347
356
  } catch (e: any) {
348
357
  this.apiError(e);
349
358
  this.errorLog(
@@ -442,10 +451,20 @@ export class Lock {
442
451
  method: 'POST',
443
452
  headers: this.platform.generateHeaders(),
444
453
  });
454
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
455
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
456
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
445
457
  const deviceStatus: any = await body.json();
446
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Devices: ${JSON.stringify(deviceStatus.body)}`);
447
- this.statusCode(statusCode);
448
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Headers: ${JSON.stringify(headers)}`);
458
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
459
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
460
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
461
+ if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
462
+ this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
463
+ + `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
464
+ } else {
465
+ this.statusCode(statusCode);
466
+ this.statusCode(deviceStatus.statusCode);
467
+ }
449
468
  } catch (e: any) {
450
469
  this.apiError(e);
451
470
  this.errorLog(
@@ -334,17 +334,26 @@ export class Meter {
334
334
  const { body, statusCode, headers } = await request(`${Devices}/${this.device.deviceId}/status`, {
335
335
  headers: this.platform.generateHeaders(),
336
336
  });
337
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
338
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
339
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
337
340
  const deviceStatus: any = await body.json();
338
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Devices: ${JSON.stringify(deviceStatus.body)}`);
339
- this.statusCode(statusCode);
340
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Headers: ${JSON.stringify(headers)}`);
341
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} refreshStatus: ${JSON.stringify(deviceStatus)}`);
342
- this.OpenAPI_CurrentRelativeHumidity = deviceStatus.body.humidity!;
343
- this.OpenAPI_CurrentTemperature = deviceStatus.body.temperature!;
344
- this.OpenAPI_BatteryLevel = deviceStatus.body.battery;
345
- this.OpenAPI_FirmwareRevision = deviceStatus.body.version;
346
- this.openAPIparseStatus();
347
- this.updateHomeKitCharacteristics();
341
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
342
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
343
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
344
+ if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
345
+ this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
346
+ + `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
347
+ this.OpenAPI_CurrentRelativeHumidity = deviceStatus.body.humidity!;
348
+ this.OpenAPI_CurrentTemperature = deviceStatus.body.temperature!;
349
+ this.OpenAPI_BatteryLevel = deviceStatus.body.battery;
350
+ this.OpenAPI_FirmwareRevision = deviceStatus.body.version;
351
+ this.openAPIparseStatus();
352
+ this.updateHomeKitCharacteristics();
353
+ } else {
354
+ this.statusCode(statusCode);
355
+ this.statusCode(deviceStatus.statusCode);
356
+ }
348
357
  } catch (e: any) {
349
358
  this.apiError(e);
350
359
  this.errorLog(
@@ -334,17 +334,26 @@ export class MeterPlus {
334
334
  const { body, statusCode, headers } = await request(`${Devices}/${this.device.deviceId}/status`, {
335
335
  headers: this.platform.generateHeaders(),
336
336
  });
337
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
338
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
339
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
337
340
  const deviceStatus: any = await body.json();
338
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Devices: ${JSON.stringify(deviceStatus.body)}`);
339
- this.statusCode(statusCode);
340
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Headers: ${JSON.stringify(headers)}`);
341
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} refreshStatus: ${JSON.stringify(deviceStatus)}`);
342
- this.OpenAPI_CurrentRelativeHumidity = deviceStatus.body.humidity!;
343
- this.OpenAPI_CurrentTemperature = deviceStatus.body.temperature!;
344
- this.OpenAPI_BatteryLevel = deviceStatus.body.battery;
345
- this.OpenAPI_FirmwareRevision = deviceStatus.body.version;
346
- this.openAPIparseStatus();
347
- this.updateHomeKitCharacteristics();
341
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
342
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
343
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
344
+ if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
345
+ this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
346
+ + `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
347
+ this.OpenAPI_CurrentRelativeHumidity = deviceStatus.body.humidity!;
348
+ this.OpenAPI_CurrentTemperature = deviceStatus.body.temperature!;
349
+ this.OpenAPI_BatteryLevel = deviceStatus.body.battery;
350
+ this.OpenAPI_FirmwareRevision = deviceStatus.body.version;
351
+ this.openAPIparseStatus();
352
+ this.updateHomeKitCharacteristics();
353
+ } else {
354
+ this.statusCode(statusCode);
355
+ this.statusCode(deviceStatus.statusCode);
356
+ }
348
357
  } catch (e: any) {
349
358
  this.apiError(e);
350
359
  this.errorLog(
@@ -343,17 +343,26 @@ export class Motion {
343
343
  const { body, statusCode, headers } = await request(`${Devices}/${this.device.deviceId}/status`, {
344
344
  headers: this.platform.generateHeaders(),
345
345
  });
346
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
347
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
348
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
346
349
  const deviceStatus: any = await body.json();
347
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Devices: ${JSON.stringify(deviceStatus.body)}`);
348
- this.statusCode(statusCode);
349
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Headers: ${JSON.stringify(headers)}`);
350
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} refreshStatus: ${JSON.stringify(deviceStatus)}`);
351
- this.OpenAPI_MotionDetected = deviceStatus.body.moveDetected;
352
- this.OpenAPI_CurrentAmbientLightLevel = deviceStatus.body.brightness;
353
- this.OpenAPI_BatteryLevel = deviceStatus.body.battery;
354
- this.OpenAPI_FirmwareRevision = deviceStatus.body.version;
355
- this.openAPIparseStatus();
356
- this.updateHomeKitCharacteristics();
350
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
351
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
352
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
353
+ if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
354
+ this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
355
+ + `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
356
+ this.OpenAPI_MotionDetected = deviceStatus.body.moveDetected;
357
+ this.OpenAPI_CurrentAmbientLightLevel = deviceStatus.body.brightness;
358
+ this.OpenAPI_BatteryLevel = deviceStatus.body.battery;
359
+ this.OpenAPI_FirmwareRevision = deviceStatus.body.version;
360
+ this.openAPIparseStatus();
361
+ this.updateHomeKitCharacteristics();
362
+ } else {
363
+ this.statusCode(statusCode);
364
+ this.statusCode(deviceStatus.statusCode);
365
+ }
357
366
  } catch (e: any) {
358
367
  this.apiError(e);
359
368
  this.errorLog(
@@ -247,14 +247,23 @@ export class Plug {
247
247
  const { body, statusCode, headers } = await request(`${Devices}/${this.device.deviceId}/status`, {
248
248
  headers: this.platform.generateHeaders(),
249
249
  });
250
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
251
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
252
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
250
253
  const deviceStatus: any = await body.json();
251
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Devices: ${JSON.stringify(deviceStatus.body)}`);
252
- this.statusCode(statusCode);
253
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Headers: ${JSON.stringify(headers)}`);
254
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} refreshStatus: ${JSON.stringify(deviceStatus)}`);
255
- this.OpenAPI_On = deviceStatus.body.power;
256
- this.openAPIparseStatus();
257
- this.updateHomeKitCharacteristics();
254
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
255
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
256
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
257
+ if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
258
+ this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
259
+ + `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
260
+ this.OpenAPI_On = deviceStatus.body.power;
261
+ this.openAPIparseStatus();
262
+ this.updateHomeKitCharacteristics();
263
+ } else {
264
+ this.statusCode(statusCode);
265
+ this.statusCode(deviceStatus.statusCode);
266
+ }
258
267
  } catch (e: any) {
259
268
  this.apiError(e);
260
269
  this.errorLog(
@@ -365,10 +374,20 @@ export class Plug {
365
374
  method: 'POST',
366
375
  headers: this.platform.generateHeaders(),
367
376
  });
377
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
378
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
379
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
368
380
  const deviceStatus: any = await body.json();
369
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Devices: ${JSON.stringify(deviceStatus.body)}`);
370
- this.statusCode(statusCode);
371
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Headers: ${JSON.stringify(headers)}`);
381
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
382
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
383
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
384
+ if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
385
+ this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
386
+ + `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
387
+ } else {
388
+ this.statusCode(statusCode);
389
+ this.statusCode(deviceStatus.statusCode);
390
+ }
372
391
  } catch (e: any) {
373
392
  this.apiError(e);
374
393
  this.errorLog(
@@ -293,16 +293,25 @@ export class RobotVacuumCleaner {
293
293
  const { body, statusCode, headers } = await request(`${Devices}/${this.device.deviceId}/status`, {
294
294
  headers: this.platform.generateHeaders(),
295
295
  });
296
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
297
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
298
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
296
299
  const deviceStatus: any = await body.json();
297
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Devices: ${JSON.stringify(deviceStatus.body)}`);
298
- this.statusCode(statusCode);
299
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Headers: ${JSON.stringify(headers)}`);
300
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} refreshStatus: ${JSON.stringify(deviceStatus)}`);
301
- this.OpenAPI_On = deviceStatus.body.power;
302
- this.OpenAPI_BatteryLevel = deviceStatus.body.battery;
303
- this.OpenAPI_FirmwareRevision = deviceStatus.body.version;
304
- this.openAPIparseStatus();
305
- this.updateHomeKitCharacteristics();
300
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
301
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
302
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
303
+ if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
304
+ this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
305
+ + `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
306
+ this.OpenAPI_On = deviceStatus.body.power;
307
+ this.OpenAPI_BatteryLevel = deviceStatus.body.battery;
308
+ this.OpenAPI_FirmwareRevision = deviceStatus.body.version;
309
+ this.openAPIparseStatus();
310
+ this.updateHomeKitCharacteristics();
311
+ } else {
312
+ this.statusCode(statusCode);
313
+ this.statusCode(deviceStatus.statusCode);
314
+ }
306
315
  } catch (e: any) {
307
316
  this.apiError(e);
308
317
  this.errorLog(
@@ -412,10 +421,20 @@ export class RobotVacuumCleaner {
412
421
  method: 'POST',
413
422
  headers: this.platform.generateHeaders(),
414
423
  });
424
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
425
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
426
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
415
427
  const deviceStatus: any = await body.json();
416
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Devices: ${JSON.stringify(deviceStatus.body)}`);
417
- this.statusCode(statusCode);
418
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Headers: ${JSON.stringify(headers)}`);
428
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
429
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
430
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
431
+ if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
432
+ this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
433
+ + `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
434
+ } else {
435
+ this.statusCode(statusCode);
436
+ this.statusCode(deviceStatus.statusCode);
437
+ }
419
438
  } catch (e: any) {
420
439
  this.apiError(e);
421
440
  this.errorLog(
@@ -441,10 +460,20 @@ export class RobotVacuumCleaner {
441
460
  method: 'POST',
442
461
  headers: this.platform.generateHeaders(),
443
462
  });
463
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
464
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
465
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
444
466
  const deviceStatus: any = await body.json();
445
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Devices: ${JSON.stringify(deviceStatus.body)}`);
446
- this.statusCode(statusCode);
447
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Headers: ${JSON.stringify(headers)}`);
467
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
468
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
469
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
470
+ if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
471
+ this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
472
+ + `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
473
+ } else {
474
+ this.statusCode(statusCode);
475
+ this.statusCode(deviceStatus.statusCode);
476
+ }
448
477
  } catch (e: any) {
449
478
  this.apiError(e);
450
479
  this.errorLog(
@@ -262,11 +262,21 @@ export class AirConditioner {
262
262
  method: 'POST',
263
263
  headers: this.platform.generateHeaders(),
264
264
  });
265
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
266
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
267
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
265
268
  const deviceStatus: any = await body.json();
266
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Devices: ${JSON.stringify(deviceStatus.body)}`);
267
- this.statusCode(statusCode);
268
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Headers: ${JSON.stringify(headers)}`);
269
- this.updateHomeKitCharacteristics();
269
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
270
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
271
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
272
+ if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
273
+ this.debugErrorLog(`${this.device.remoteType}: ${this.accessory.displayName} `
274
+ + `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
275
+ this.updateHomeKitCharacteristics();
276
+ } else {
277
+ this.statusCode(statusCode);
278
+ this.statusCode(deviceStatus.statusCode);
279
+ }
270
280
  } catch (e: any) {
271
281
  this.apiError(e);
272
282
  this.errorLog(
@@ -218,11 +218,21 @@ export class AirPurifier {
218
218
  method: 'POST',
219
219
  headers: this.platform.generateHeaders(),
220
220
  });
221
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
222
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
223
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
221
224
  const deviceStatus: any = await body.json();
222
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Devices: ${JSON.stringify(deviceStatus.body)}`);
223
- this.statusCode(statusCode);
224
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Headers: ${JSON.stringify(headers)}`);
225
- this.updateHomeKitCharacteristics();
225
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
226
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
227
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
228
+ if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
229
+ this.debugErrorLog(`${this.device.remoteType}: ${this.accessory.displayName} `
230
+ + `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
231
+ this.updateHomeKitCharacteristics();
232
+ } else {
233
+ this.statusCode(statusCode);
234
+ this.statusCode(deviceStatus.statusCode);
235
+ }
226
236
  } catch (e: any) {
227
237
  this.apiError(e);
228
238
  this.errorLog(
@@ -123,11 +123,21 @@ export class Camera {
123
123
  method: 'POST',
124
124
  headers: this.platform.generateHeaders(),
125
125
  });
126
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
127
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
128
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
126
129
  const deviceStatus: any = await body.json();
127
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Devices: ${JSON.stringify(deviceStatus.body)}`);
128
- this.statusCode(statusCode);
129
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Headers: ${JSON.stringify(headers)}`);
130
- this.updateHomeKitCharacteristics();
130
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
131
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
132
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
133
+ if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
134
+ this.debugErrorLog(`${this.device.remoteType}: ${this.accessory.displayName} `
135
+ + `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
136
+ this.updateHomeKitCharacteristics();
137
+ } else {
138
+ this.statusCode(statusCode);
139
+ this.statusCode(deviceStatus.statusCode);
140
+ }
131
141
  } catch (e: any) {
132
142
  this.apiError(e);
133
143
  this.errorLog(
@@ -240,11 +240,21 @@ export class Fan {
240
240
  method: 'POST',
241
241
  headers: this.platform.generateHeaders(),
242
242
  });
243
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
244
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
245
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
243
246
  const deviceStatus: any = await body.json();
244
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Devices: ${JSON.stringify(deviceStatus.body)}`);
245
- this.statusCode(statusCode);
246
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Headers: ${JSON.stringify(headers)}`);
247
- this.updateHomeKitCharacteristics();
247
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
248
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
249
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
250
+ if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
251
+ this.debugErrorLog(`${this.device.remoteType}: ${this.accessory.displayName} `
252
+ + `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
253
+ this.updateHomeKitCharacteristics();
254
+ } else {
255
+ this.statusCode(statusCode);
256
+ this.statusCode(deviceStatus.statusCode);
257
+ }
248
258
  } catch (e: any) {
249
259
  this.apiError(e);
250
260
  this.errorLog(
@@ -147,12 +147,22 @@ export class Light {
147
147
  method: 'POST',
148
148
  headers: this.platform.generateHeaders(),
149
149
  });
150
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
151
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
152
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
150
153
  const deviceStatus: any = await body.json();
151
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Devices: ${JSON.stringify(deviceStatus.body)}`);
152
- this.statusCode(statusCode);
153
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Headers: ${JSON.stringify(headers)}`);
154
- this.accessory.context.On = this.On;
155
- this.updateHomeKitCharacteristics();
154
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
155
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
156
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
157
+ if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
158
+ this.debugErrorLog(`${this.device.remoteType}: ${this.accessory.displayName} `
159
+ + `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
160
+ this.accessory.context.On = this.On;
161
+ this.updateHomeKitCharacteristics();
162
+ } else {
163
+ this.statusCode(statusCode);
164
+ this.statusCode(deviceStatus.statusCode);
165
+ }
156
166
  } catch (e: any) {
157
167
  this.apiError(e);
158
168
  this.errorLog(
@@ -142,11 +142,21 @@ export class Others {
142
142
  method: 'POST',
143
143
  headers: this.platform.generateHeaders(),
144
144
  });
145
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
146
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
147
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
145
148
  const deviceStatus: any = await body.json();
146
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Devices: ${JSON.stringify(deviceStatus.body)}`);
147
- this.statusCode(statusCode);
148
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Headers: ${JSON.stringify(headers)}`);
149
- this.updateHomeKitCharacteristics();
149
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
150
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
151
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
152
+ if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
153
+ this.debugErrorLog(`${this.device.remoteType}: ${this.accessory.displayName} `
154
+ + `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
155
+ this.updateHomeKitCharacteristics();
156
+ } else {
157
+ this.statusCode(statusCode);
158
+ this.statusCode(deviceStatus.statusCode);
159
+ }
150
160
  } catch (e: any) {
151
161
  this.apiError(e);
152
162
  this.errorLog(