@switchbot/homebridge-switchbot 2.8.1-beta.16 → 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.
- package/CHANGELOG.md +8 -0
- package/dist/device/blindtilt.d.ts.map +1 -1
- package/dist/device/blindtilt.js +36 -15
- package/dist/device/blindtilt.js.map +1 -1
- package/dist/device/bot.d.ts.map +1 -1
- package/dist/device/bot.js +28 -21
- package/dist/device/bot.js.map +1 -1
- package/dist/device/ceilinglight.d.ts.map +1 -1
- package/dist/device/ceilinglight.js +77 -23
- package/dist/device/ceilinglight.js.map +1 -1
- package/dist/device/colorbulb.d.ts.map +1 -1
- package/dist/device/colorbulb.js +77 -23
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/device/contact.d.ts.map +1 -1
- package/dist/device/contact.js +21 -11
- package/dist/device/contact.js.map +1 -1
- package/dist/device/curtain.d.ts.map +1 -1
- package/dist/device/curtain.js +35 -14
- package/dist/device/curtain.js.map +1 -1
- package/dist/device/hub.d.ts.map +1 -1
- package/dist/device/hub.js +20 -10
- package/dist/device/hub.js.map +1 -1
- package/dist/device/humidifier.d.ts.map +1 -1
- package/dist/device/humidifier.js +65 -22
- package/dist/device/humidifier.js.map +1 -1
- package/dist/device/iosensor.d.ts.map +1 -1
- package/dist/device/iosensor.js +20 -10
- package/dist/device/iosensor.js.map +1 -1
- package/dist/device/lightstrip.d.ts.map +1 -1
- package/dist/device/lightstrip.js +62 -19
- package/dist/device/lightstrip.js.map +1 -1
- package/dist/device/lock.d.ts.map +1 -1
- package/dist/device/lock.js +34 -13
- package/dist/device/lock.js.map +1 -1
- package/dist/device/meter.d.ts.map +1 -1
- package/dist/device/meter.js +20 -10
- package/dist/device/meter.js.map +1 -1
- package/dist/device/meterplus.d.ts.map +1 -1
- package/dist/device/meterplus.js +20 -10
- package/dist/device/meterplus.js.map +1 -1
- package/dist/device/motion.d.ts.map +1 -1
- package/dist/device/motion.js +20 -10
- package/dist/device/motion.js.map +1 -1
- package/dist/device/plug.d.ts.map +1 -1
- package/dist/device/plug.js +31 -10
- package/dist/device/plug.js.map +1 -1
- package/dist/device/robotvacuumcleaner.d.ts.map +1 -1
- package/dist/device/robotvacuumcleaner.js +47 -15
- package/dist/device/robotvacuumcleaner.js.map +1 -1
- package/dist/irdevice/airconditioner.d.ts.map +1 -1
- package/dist/irdevice/airconditioner.js +15 -4
- package/dist/irdevice/airconditioner.js.map +1 -1
- package/dist/irdevice/airpurifier.d.ts.map +1 -1
- package/dist/irdevice/airpurifier.js +15 -4
- package/dist/irdevice/airpurifier.js.map +1 -1
- package/dist/irdevice/camera.d.ts.map +1 -1
- package/dist/irdevice/camera.js +15 -4
- package/dist/irdevice/camera.js.map +1 -1
- package/dist/irdevice/fan.d.ts.map +1 -1
- package/dist/irdevice/fan.js +15 -4
- package/dist/irdevice/fan.js.map +1 -1
- package/dist/irdevice/light.d.ts.map +1 -1
- package/dist/irdevice/light.js +16 -5
- package/dist/irdevice/light.js.map +1 -1
- package/dist/irdevice/other.d.ts.map +1 -1
- package/dist/irdevice/other.js +15 -4
- package/dist/irdevice/other.js.map +1 -1
- package/dist/irdevice/tv.d.ts.map +1 -1
- package/dist/irdevice/tv.js +15 -4
- package/dist/irdevice/tv.js.map +1 -1
- package/dist/irdevice/vacuumcleaner.d.ts.map +1 -1
- package/dist/irdevice/vacuumcleaner.js +15 -4
- package/dist/irdevice/vacuumcleaner.js.map +1 -1
- package/dist/irdevice/waterheater.d.ts.map +1 -1
- package/dist/irdevice/waterheater.js +15 -4
- package/dist/irdevice/waterheater.js.map +1 -1
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +19 -3
- package/dist/platform.js.map +1 -1
- package/package.json +1 -1
- package/src/device/blindtilt.ts +34 -15
- package/src/device/bot.ts +28 -21
- package/src/device/ceilinglight.ts +72 -23
- package/src/device/colorbulb.ts +72 -23
- package/src/device/contact.ts +20 -11
- package/src/device/curtain.ts +33 -14
- package/src/device/hub.ts +19 -10
- package/src/device/humidifier.ts +61 -22
- package/src/device/iosensor.ts +19 -10
- package/src/device/lightstrip.ts +58 -19
- package/src/device/lock.ts +32 -13
- package/src/device/meter.ts +19 -10
- package/src/device/meterplus.ts +19 -10
- package/src/device/motion.ts +19 -10
- package/src/device/plug.ts +29 -10
- package/src/device/robotvacuumcleaner.ts +44 -15
- package/src/irdevice/airconditioner.ts +14 -4
- package/src/irdevice/airpurifier.ts +14 -4
- package/src/irdevice/camera.ts +14 -4
- package/src/irdevice/fan.ts +14 -4
- package/src/irdevice/light.ts +15 -5
- package/src/irdevice/other.ts +14 -4
- package/src/irdevice/tv.ts +14 -4
- package/src/irdevice/vacuumcleaner.ts +14 -4
- package/src/irdevice/waterheater.ts +14 -4
- package/src/platform.ts +16 -3
|
@@ -402,18 +402,27 @@ export class CeilingLight {
|
|
|
402
402
|
const { body, statusCode, headers } = await request(`${Devices}/${this.device.deviceId}/status`, {
|
|
403
403
|
headers: this.platform.generateHeaders(),
|
|
404
404
|
});
|
|
405
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
406
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
407
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
405
408
|
const deviceStatus: any = await body.json();
|
|
406
|
-
this.
|
|
407
|
-
this.
|
|
408
|
-
this.
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
409
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
410
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
411
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
412
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
413
|
+
this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
414
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
415
|
+
this.OpenAPI_On = deviceStatus.body.power;
|
|
416
|
+
this.OpenAPI_RGB = deviceStatus.body.color;
|
|
417
|
+
this.OpenAPI_Brightness = deviceStatus.body.brightness;
|
|
418
|
+
this.OpenAPI_ColorTemperature = deviceStatus.body.colorTemperature;
|
|
419
|
+
this.OpenAPI_FirmwareRevision = deviceStatus.body.version;
|
|
420
|
+
this.openAPIparseStatus();
|
|
421
|
+
this.updateHomeKitCharacteristics();
|
|
422
|
+
} else {
|
|
423
|
+
this.statusCode(statusCode);
|
|
424
|
+
this.statusCode(deviceStatus.statusCode);
|
|
425
|
+
}
|
|
417
426
|
} catch (e: any) {
|
|
418
427
|
this.apiError(e);
|
|
419
428
|
this.errorLog(
|
|
@@ -525,10 +534,20 @@ export class CeilingLight {
|
|
|
525
534
|
method: 'POST',
|
|
526
535
|
headers: this.platform.generateHeaders(),
|
|
527
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)}`);
|
|
528
540
|
const deviceStatus: any = await body.json();
|
|
529
|
-
this.
|
|
530
|
-
this.
|
|
531
|
-
this.
|
|
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
|
+
}
|
|
532
551
|
} catch (e: any) {
|
|
533
552
|
this.apiError(e);
|
|
534
553
|
this.errorLog(
|
|
@@ -576,10 +595,20 @@ export class CeilingLight {
|
|
|
576
595
|
method: 'POST',
|
|
577
596
|
headers: this.platform.generateHeaders(),
|
|
578
597
|
});
|
|
598
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
599
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
600
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
579
601
|
const deviceStatus: any = await body.json();
|
|
580
|
-
this.
|
|
581
|
-
this.
|
|
582
|
-
this.
|
|
602
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
603
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
604
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
605
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
606
|
+
this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
607
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
608
|
+
} else {
|
|
609
|
+
this.statusCode(statusCode);
|
|
610
|
+
this.statusCode(deviceStatus.statusCode);
|
|
611
|
+
}
|
|
583
612
|
} catch (e: any) {
|
|
584
613
|
this.apiError(e);
|
|
585
614
|
this.errorLog(
|
|
@@ -612,10 +641,20 @@ export class CeilingLight {
|
|
|
612
641
|
method: 'POST',
|
|
613
642
|
headers: this.platform.generateHeaders(),
|
|
614
643
|
});
|
|
644
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
645
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
646
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
615
647
|
const deviceStatus: any = await body.json();
|
|
616
|
-
this.
|
|
617
|
-
this.
|
|
618
|
-
this.
|
|
648
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
649
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
650
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
651
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
652
|
+
this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
653
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
654
|
+
} else {
|
|
655
|
+
this.statusCode(statusCode);
|
|
656
|
+
this.statusCode(deviceStatus.statusCode);
|
|
657
|
+
}
|
|
619
658
|
} catch (e: any) {
|
|
620
659
|
this.apiError(e);
|
|
621
660
|
this.errorLog(
|
|
@@ -646,10 +685,20 @@ export class CeilingLight {
|
|
|
646
685
|
method: 'POST',
|
|
647
686
|
headers: this.platform.generateHeaders(),
|
|
648
687
|
});
|
|
688
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
689
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
690
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
649
691
|
const deviceStatus: any = await body.json();
|
|
650
|
-
this.
|
|
651
|
-
this.
|
|
652
|
-
this.
|
|
692
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
693
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
694
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
695
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
696
|
+
this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
697
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
698
|
+
} else {
|
|
699
|
+
this.statusCode(statusCode);
|
|
700
|
+
this.statusCode(deviceStatus.statusCode);
|
|
701
|
+
}
|
|
653
702
|
} catch (e: any) {
|
|
654
703
|
this.apiError(e);
|
|
655
704
|
this.errorLog(
|
package/src/device/colorbulb.ts
CHANGED
|
@@ -429,18 +429,27 @@ export class ColorBulb {
|
|
|
429
429
|
const { body, statusCode, headers } = await request(`${Devices}/${this.device.deviceId}/status`, {
|
|
430
430
|
headers: this.platform.generateHeaders(),
|
|
431
431
|
});
|
|
432
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
433
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
434
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
432
435
|
const deviceStatus: any = await body.json();
|
|
433
|
-
this.
|
|
434
|
-
this.
|
|
435
|
-
this.
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
436
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
437
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
438
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
439
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
440
|
+
this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
441
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
442
|
+
this.OpenAPI_On = deviceStatus.body.power;
|
|
443
|
+
this.OpenAPI_RGB = deviceStatus.body.color;
|
|
444
|
+
this.OpenAPI_Brightness = deviceStatus.body.brightness;
|
|
445
|
+
this.OpenAPI_ColorTemperature = deviceStatus.body.colorTemperature;
|
|
446
|
+
this.OpenAPI_FirmwareRevision = deviceStatus.body.version;
|
|
447
|
+
this.openAPIparseStatus();
|
|
448
|
+
this.updateHomeKitCharacteristics();
|
|
449
|
+
} else {
|
|
450
|
+
this.statusCode(statusCode);
|
|
451
|
+
this.statusCode(deviceStatus.statusCode);
|
|
452
|
+
}
|
|
444
453
|
} catch (e: any) {
|
|
445
454
|
this.apiError(e);
|
|
446
455
|
this.errorLog(
|
|
@@ -688,10 +697,20 @@ export class ColorBulb {
|
|
|
688
697
|
method: 'POST',
|
|
689
698
|
headers: this.platform.generateHeaders(),
|
|
690
699
|
});
|
|
700
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
701
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
702
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
691
703
|
const deviceStatus: any = await body.json();
|
|
692
|
-
this.
|
|
693
|
-
this.
|
|
694
|
-
this.
|
|
704
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
705
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
706
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
707
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
708
|
+
this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
709
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
710
|
+
} else {
|
|
711
|
+
this.statusCode(statusCode);
|
|
712
|
+
this.statusCode(deviceStatus.statusCode);
|
|
713
|
+
}
|
|
695
714
|
} catch (e: any) {
|
|
696
715
|
this.apiError(e);
|
|
697
716
|
this.errorLog(
|
|
@@ -739,10 +758,20 @@ export class ColorBulb {
|
|
|
739
758
|
method: 'POST',
|
|
740
759
|
headers: this.platform.generateHeaders(),
|
|
741
760
|
});
|
|
761
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
762
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
763
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
742
764
|
const deviceStatus: any = await body.json();
|
|
743
|
-
this.
|
|
744
|
-
this.
|
|
745
|
-
this.
|
|
765
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
766
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
767
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
768
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
769
|
+
this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
770
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
771
|
+
} else {
|
|
772
|
+
this.statusCode(statusCode);
|
|
773
|
+
this.statusCode(deviceStatus.statusCode);
|
|
774
|
+
}
|
|
746
775
|
} catch (e: any) {
|
|
747
776
|
this.apiError(e);
|
|
748
777
|
this.errorLog(
|
|
@@ -775,10 +804,20 @@ export class ColorBulb {
|
|
|
775
804
|
method: 'POST',
|
|
776
805
|
headers: this.platform.generateHeaders(),
|
|
777
806
|
});
|
|
807
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
808
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
809
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
778
810
|
const deviceStatus: any = await body.json();
|
|
779
|
-
this.
|
|
780
|
-
this.
|
|
781
|
-
this.
|
|
811
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
812
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
813
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
814
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
815
|
+
this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
816
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
817
|
+
} else {
|
|
818
|
+
this.statusCode(statusCode);
|
|
819
|
+
this.statusCode(deviceStatus.statusCode);
|
|
820
|
+
}
|
|
782
821
|
} catch (e: any) {
|
|
783
822
|
this.apiError(e);
|
|
784
823
|
this.errorLog(
|
|
@@ -809,10 +848,20 @@ export class ColorBulb {
|
|
|
809
848
|
method: 'POST',
|
|
810
849
|
headers: this.platform.generateHeaders(),
|
|
811
850
|
});
|
|
851
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
852
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
853
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
812
854
|
const deviceStatus: any = await body.json();
|
|
813
|
-
this.
|
|
814
|
-
this.
|
|
815
|
-
this.
|
|
855
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
856
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
857
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
858
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
859
|
+
this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
860
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
861
|
+
} else {
|
|
862
|
+
this.statusCode(statusCode);
|
|
863
|
+
this.statusCode(deviceStatus.statusCode);
|
|
864
|
+
}
|
|
816
865
|
} catch (e: any) {
|
|
817
866
|
this.apiError(e);
|
|
818
867
|
this.errorLog(
|
package/src/device/contact.ts
CHANGED
|
@@ -382,18 +382,27 @@ export class Contact {
|
|
|
382
382
|
const { body, statusCode, headers } = await request(`${Devices}/${this.device.deviceId}/status`, {
|
|
383
383
|
headers: this.platform.generateHeaders(),
|
|
384
384
|
});
|
|
385
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
386
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
387
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
385
388
|
const deviceStatus: any = await body.json();
|
|
386
|
-
this.
|
|
387
|
-
this.
|
|
388
|
-
this.
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
389
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
390
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
391
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
392
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
393
|
+
this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
394
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
395
|
+
this.OpenAPI_ContactSensorState = deviceStatus.body.openState;
|
|
396
|
+
this.OpenAPI_MotionDetected = deviceStatus.body.moveDetected;
|
|
397
|
+
this.OpenAPI_CurrentAmbientLightLevel = deviceStatus.body.brightness;
|
|
398
|
+
this.OpenAPI_BatteryLevel = deviceStatus.body.battery;
|
|
399
|
+
this.OpenAPI_FirmwareRevision = deviceStatus.body.version;
|
|
400
|
+
this.openAPIparseStatus();
|
|
401
|
+
this.updateHomeKitCharacteristics();
|
|
402
|
+
} else {
|
|
403
|
+
this.statusCode(statusCode);
|
|
404
|
+
this.statusCode(deviceStatus.statusCode);
|
|
405
|
+
}
|
|
397
406
|
} catch (e: any) {
|
|
398
407
|
this.apiError(e);
|
|
399
408
|
this.errorLog(
|
package/src/device/curtain.ts
CHANGED
|
@@ -550,18 +550,27 @@ export class Curtain {
|
|
|
550
550
|
const { body, statusCode, headers } = await request(`${Devices}/${this.device.deviceId}/status`, {
|
|
551
551
|
headers: this.platform.generateHeaders(),
|
|
552
552
|
});
|
|
553
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
554
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
555
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
553
556
|
const deviceStatus: any = await body.json();
|
|
554
|
-
this.
|
|
555
|
-
this.
|
|
556
|
-
this.
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
557
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
558
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
559
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
560
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
561
|
+
this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
562
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
563
|
+
this.OpenAPI_CurrentPosition = deviceStatus.body.slidePosition;
|
|
564
|
+
this.OpenAPI_InMotion = deviceStatus.body.moving;
|
|
565
|
+
this.OpenAPI_CurrentAmbientLightLevel = deviceStatus.body.brightness;
|
|
566
|
+
this.OpenAPI_BatterLevel = deviceStatus.body.battery;
|
|
567
|
+
this.OpenAPI_FirmwareRevision = deviceStatus.body.version;
|
|
568
|
+
this.openAPIparseStatus();
|
|
569
|
+
this.updateHomeKitCharacteristics();
|
|
570
|
+
} else {
|
|
571
|
+
this.statusCode(statusCode);
|
|
572
|
+
this.statusCode(deviceStatus.statusCode);
|
|
573
|
+
}
|
|
565
574
|
} catch (e: any) {
|
|
566
575
|
this.apiError(e);
|
|
567
576
|
this.errorLog(
|
|
@@ -696,10 +705,20 @@ export class Curtain {
|
|
|
696
705
|
method: 'POST',
|
|
697
706
|
headers: this.platform.generateHeaders(),
|
|
698
707
|
});
|
|
708
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
709
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
710
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
699
711
|
const deviceStatus: any = await body.json();
|
|
700
|
-
this.
|
|
701
|
-
this.
|
|
702
|
-
this.
|
|
712
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
713
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
714
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
715
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
716
|
+
this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
717
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
718
|
+
} else {
|
|
719
|
+
this.statusCode(statusCode);
|
|
720
|
+
this.statusCode(deviceStatus.statusCode);
|
|
721
|
+
}
|
|
703
722
|
} catch (e: any) {
|
|
704
723
|
this.apiError(e);
|
|
705
724
|
this.errorLog(
|
package/src/device/hub.ts
CHANGED
|
@@ -290,17 +290,26 @@ export class Hub {
|
|
|
290
290
|
const { body, statusCode, headers } = await request(`${Devices}/${this.device.deviceId}/status`, {
|
|
291
291
|
headers: this.platform.generateHeaders(),
|
|
292
292
|
});
|
|
293
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
294
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
295
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
293
296
|
const deviceStatus: any = await body.json();
|
|
294
|
-
this.
|
|
295
|
-
this.
|
|
296
|
-
this.
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
297
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
298
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
299
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
300
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
301
|
+
this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
302
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
303
|
+
this.OpenAPI_CurrentTemperature = deviceStatus.body.temperature;
|
|
304
|
+
this.OpenAPI_CurrentRelativeHumidity = deviceStatus.body.humidity;
|
|
305
|
+
this.OpenAPI_CurrentAmbientLightLevel = deviceStatus.body.lightLevel;
|
|
306
|
+
this.OpenAPI_FirmwareRevision = deviceStatus.body.version;
|
|
307
|
+
this.openAPIparseStatus();
|
|
308
|
+
this.updateHomeKitCharacteristics();
|
|
309
|
+
} else {
|
|
310
|
+
this.statusCode(statusCode);
|
|
311
|
+
this.statusCode(deviceStatus.statusCode);
|
|
312
|
+
}
|
|
304
313
|
} catch (e: any) {
|
|
305
314
|
this.apiError(e);
|
|
306
315
|
this.errorLog(
|
package/src/device/humidifier.ts
CHANGED
|
@@ -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.
|
|
380
|
-
this.
|
|
381
|
-
this.
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
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.
|
|
477
|
-
this.
|
|
478
|
-
this.
|
|
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.
|
|
520
|
-
this.
|
|
521
|
-
this.
|
|
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.
|
|
558
|
-
this.
|
|
559
|
-
this.
|
|
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(
|
package/src/device/iosensor.ts
CHANGED
|
@@ -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.
|
|
338
|
-
this.
|
|
339
|
-
this.
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
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(
|