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

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 +37 -16
  3. package/dist/device/blindtilt.js.map +1 -1
  4. package/dist/device/bot.js +10 -10
  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 +78 -24
  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 +36 -5
  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 +22 -12
  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 +36 -15
  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 +21 -11
  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 +66 -23
  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 +21 -11
  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 +63 -20
  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 +35 -14
  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 +21 -11
  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 +21 -11
  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 +21 -11
  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 +32 -11
  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 +48 -16
  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 +35 -16
  80. package/src/device/bot.ts +11 -11
  81. package/src/device/ceilinglight.ts +73 -24
  82. package/src/device/colorbulb.ts +32 -5
  83. package/src/device/contact.ts +21 -12
  84. package/src/device/curtain.ts +34 -15
  85. package/src/device/hub.ts +20 -11
  86. package/src/device/humidifier.ts +62 -23
  87. package/src/device/iosensor.ts +20 -11
  88. package/src/device/lightstrip.ts +59 -20
  89. package/src/device/lock.ts +33 -14
  90. package/src/device/meter.ts +20 -11
  91. package/src/device/meterplus.ts +20 -11
  92. package/src/device/motion.ts +20 -11
  93. package/src/device/plug.ts +30 -11
  94. package/src/device/robotvacuumcleaner.ts +45 -16
  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
@@ -375,20 +375,29 @@ export class Humidifier {
375
375
  const { body, statusCode, headers } = await request(`${Devices}/${this.device.deviceId}/status`, {
376
376
  headers: this.platform.generateHeaders(),
377
377
  });
378
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
379
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
380
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
378
381
  const deviceStatus: any = await body.json();
379
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Devices: ${JSON.stringify(deviceStatus.body)}`);
380
- this.statusCode(statusCode);
381
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Headers: ${JSON.stringify(headers)}`);
382
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} refreshStatus: ${JSON.stringify(deviceStatus)}`);
383
- this.OpenAPI_CurrentHumidifierDehumidifierState = deviceStatus.body.auto;
384
- this.OpenAPI_Active = deviceStatus.body.power;
385
- this.OpenAPI_WaterLevel = deviceStatus.body.lackWater;
386
- this.OpenAPI_CurrentRelativeHumidity = deviceStatus.body.humidity;
387
- this.OpenAPI_CurrentTemperature = deviceStatus.body.temperature;
388
- this.OpenAPI_RelativeHumidityHumidifierThreshold = deviceStatus.body.nebulizationEfficiency;
389
- this.OpenAPI_FirmwareRevision = deviceStatus.body.version;
390
- this.openAPIparseStatus();
391
- this.updateHomeKitCharacteristics();
382
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
383
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
384
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
385
+ if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
386
+ this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
387
+ + `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
388
+ this.OpenAPI_CurrentHumidifierDehumidifierState = deviceStatus.body.auto;
389
+ this.OpenAPI_Active = deviceStatus.body.power;
390
+ this.OpenAPI_WaterLevel = deviceStatus.body.lackWater;
391
+ this.OpenAPI_CurrentRelativeHumidity = deviceStatus.body.humidity;
392
+ this.OpenAPI_CurrentTemperature = deviceStatus.body.temperature;
393
+ this.OpenAPI_RelativeHumidityHumidifierThreshold = deviceStatus.body.nebulizationEfficiency;
394
+ this.OpenAPI_FirmwareRevision = deviceStatus.body.version;
395
+ this.openAPIparseStatus();
396
+ this.updateHomeKitCharacteristics();
397
+ } else {
398
+ this.statusCode(statusCode);
399
+ this.statusCode(deviceStatus.statusCode);
400
+ }
392
401
  } catch (e: any) {
393
402
  this.apiError(e);
394
403
  this.errorLog(
@@ -472,10 +481,20 @@ export class Humidifier {
472
481
  method: 'POST',
473
482
  headers: this.platform.generateHeaders(),
474
483
  });
484
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
485
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
486
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
475
487
  const deviceStatus: any = await body.json();
476
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Devices: ${JSON.stringify(deviceStatus.body)}`);
477
- this.statusCode(statusCode);
478
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Headers: ${JSON.stringify(headers)}`);
488
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
489
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
490
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
491
+ if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
492
+ this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
493
+ + `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
494
+ } else {
495
+ this.statusCode(statusCode);
496
+ this.statusCode(deviceStatus.statusCode);
497
+ }
479
498
  } catch (e: any) {
480
499
  this.apiError(e);
481
500
  this.errorLog(
@@ -515,10 +534,20 @@ export class Humidifier {
515
534
  method: 'POST',
516
535
  headers: this.platform.generateHeaders(),
517
536
  });
537
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
538
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
539
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
518
540
  const deviceStatus: any = await body.json();
519
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Devices: ${JSON.stringify(deviceStatus.body)}`);
520
- this.statusCode(statusCode);
521
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Headers: ${JSON.stringify(headers)}`);
541
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
542
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
543
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
544
+ if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
545
+ this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
546
+ + `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
547
+ } else {
548
+ this.statusCode(statusCode);
549
+ this.statusCode(deviceStatus.statusCode);
550
+ }
522
551
  } catch (e: any) {
523
552
  this.apiError(e);
524
553
  this.errorLog(
@@ -553,10 +582,20 @@ export class Humidifier {
553
582
  method: 'POST',
554
583
  headers: this.platform.generateHeaders(),
555
584
  });
585
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
586
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
587
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
556
588
  const deviceStatus: any = await body.json();
557
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Devices: ${JSON.stringify(deviceStatus.body)}`);
558
- this.statusCode(statusCode);
559
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Headers: ${JSON.stringify(headers)}`);
589
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
590
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
591
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
592
+ if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
593
+ this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
594
+ + `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
595
+ } else {
596
+ this.statusCode(statusCode);
597
+ this.statusCode(deviceStatus.statusCode);
598
+ }
560
599
  } catch (e: any) {
561
600
  this.apiError(e);
562
601
  this.errorLog(
@@ -708,7 +747,7 @@ export class Humidifier {
708
747
  this.accessory.getService(this.platform.Service.AccessoryInformation)!
709
748
  .updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.OpenAPI_FirmwareRevision);
710
749
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} `
711
- + `updateCharacteristic CurrentTemperature: ${this.OpenAPI_FirmwareRevision}`);
750
+ + `updateCharacteristic FirmwareRevision: ${this.OpenAPI_FirmwareRevision}`);
712
751
  }
713
752
  }
714
753
 
@@ -333,17 +333,26 @@ export class IOSensor {
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_CurrentRelativeHumidity = deviceStatus.body.humidity!;
342
- this.OpenAPI_CurrentTemperature = deviceStatus.body.temperature!;
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_CurrentRelativeHumidity = deviceStatus.body.humidity!;
347
+ this.OpenAPI_CurrentTemperature = deviceStatus.body.temperature!;
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(
@@ -429,7 +438,7 @@ export class IOSensor {
429
438
  this.accessory.getService(this.platform.Service.AccessoryInformation)!
430
439
  .updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.OpenAPI_FirmwareRevision);
431
440
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} `
432
- + `updateCharacteristic CurrentTemperature: ${this.OpenAPI_FirmwareRevision}`);
441
+ + `updateCharacteristic FirmwareRevision: ${this.OpenAPI_FirmwareRevision}`);
433
442
  }
434
443
  }
435
444
 
@@ -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(
@@ -826,7 +865,7 @@ export class StripLight {
826
865
  this.accessory.getService(this.platform.Service.AccessoryInformation)!
827
866
  .updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.OpenAPI_FirmwareRevision);
828
867
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} `
829
- + `updateCharacteristic CurrentTemperature: ${this.OpenAPI_FirmwareRevision}`);
868
+ + `updateCharacteristic FirmwareRevision: ${this.OpenAPI_FirmwareRevision}`);
830
869
  }
831
870
  }
832
871
 
@@ -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(
@@ -522,7 +541,7 @@ export class Lock {
522
541
  this.accessory.getService(this.platform.Service.AccessoryInformation)!
523
542
  .updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.OpenAPI_FirmwareRevision);
524
543
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} `
525
- + `updateCharacteristic CurrentTemperature: ${this.OpenAPI_FirmwareRevision}`);
544
+ + `updateCharacteristic FirmwareRevision: ${this.OpenAPI_FirmwareRevision}`);
526
545
  }
527
546
  }
528
547
 
@@ -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(
@@ -432,7 +441,7 @@ export class Meter {
432
441
  this.accessory.getService(this.platform.Service.AccessoryInformation)!
433
442
  .updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.OpenAPI_FirmwareRevision);
434
443
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} `
435
- + `updateCharacteristic CurrentTemperature: ${this.OpenAPI_FirmwareRevision}`);
444
+ + `updateCharacteristic FirmwareRevision: ${this.OpenAPI_FirmwareRevision}`);
436
445
  }
437
446
  }
438
447
 
@@ -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(
@@ -432,7 +441,7 @@ export class MeterPlus {
432
441
  this.accessory.getService(this.platform.Service.AccessoryInformation)!
433
442
  .updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.OpenAPI_FirmwareRevision);
434
443
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} `
435
- + `updateCharacteristic CurrentTemperature: ${this.OpenAPI_FirmwareRevision}`);
444
+ + `updateCharacteristic FirmwareRevision: ${this.OpenAPI_FirmwareRevision}`);
436
445
  }
437
446
  }
438
447
 
@@ -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(
@@ -408,7 +417,7 @@ export class Motion {
408
417
  this.accessory.getService(this.platform.Service.AccessoryInformation)!
409
418
  .updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.OpenAPI_FirmwareRevision);
410
419
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} `
411
- + `updateCharacteristic CurrentTemperature: ${this.OpenAPI_FirmwareRevision}`);
420
+ + `updateCharacteristic FirmwareRevision: ${this.OpenAPI_FirmwareRevision}`);
412
421
  }
413
422
  }
414
423
 
@@ -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(
@@ -415,7 +434,7 @@ export class Plug {
415
434
  this.accessory.getService(this.platform.Service.AccessoryInformation)!
416
435
  .updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.OpenAPI_FirmwareRevision);
417
436
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} `
418
- + `updateCharacteristic CurrentTemperature: ${this.OpenAPI_FirmwareRevision}`);
437
+ + `updateCharacteristic FirmwareRevision: ${this.OpenAPI_FirmwareRevision}`);
419
438
  }
420
439
  }
421
440