@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.
- 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.js +9 -9
- 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 +35 -4
- 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 +18 -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 +10 -10
- package/src/device/ceilinglight.ts +72 -23
- package/src/device/colorbulb.ts +31 -4
- 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 +15 -3
package/src/device/lightstrip.ts
CHANGED
|
@@ -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.
|
|
374
|
-
this.
|
|
375
|
-
this.
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
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.
|
|
588
|
-
this.
|
|
589
|
-
this.
|
|
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.
|
|
636
|
-
this.
|
|
637
|
-
this.
|
|
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.
|
|
670
|
-
this.
|
|
671
|
-
this.
|
|
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(
|
package/src/device/lock.ts
CHANGED
|
@@ -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.
|
|
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_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.
|
|
447
|
-
this.
|
|
448
|
-
this.
|
|
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(
|
package/src/device/meter.ts
CHANGED
|
@@ -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.
|
|
339
|
-
this.
|
|
340
|
-
this.
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
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(
|
package/src/device/meterplus.ts
CHANGED
|
@@ -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.
|
|
339
|
-
this.
|
|
340
|
-
this.
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
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(
|
package/src/device/motion.ts
CHANGED
|
@@ -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.
|
|
348
|
-
this.
|
|
349
|
-
this.
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
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(
|
package/src/device/plug.ts
CHANGED
|
@@ -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.
|
|
252
|
-
this.
|
|
253
|
-
this.
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
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.
|
|
370
|
-
this.
|
|
371
|
-
this.
|
|
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.
|
|
298
|
-
this.
|
|
299
|
-
this.
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
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.
|
|
417
|
-
this.
|
|
418
|
-
this.
|
|
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.
|
|
446
|
-
this.
|
|
447
|
-
this.
|
|
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.
|
|
267
|
-
this.
|
|
268
|
-
this.
|
|
269
|
-
|
|
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.
|
|
223
|
-
this.
|
|
224
|
-
this.
|
|
225
|
-
|
|
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(
|
package/src/irdevice/camera.ts
CHANGED
|
@@ -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.
|
|
128
|
-
this.
|
|
129
|
-
this.
|
|
130
|
-
|
|
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(
|
package/src/irdevice/fan.ts
CHANGED
|
@@ -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.
|
|
245
|
-
this.
|
|
246
|
-
this.
|
|
247
|
-
|
|
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(
|
package/src/irdevice/light.ts
CHANGED
|
@@ -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.
|
|
152
|
-
this.
|
|
153
|
-
this.
|
|
154
|
-
|
|
155
|
-
|
|
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(
|
package/src/irdevice/other.ts
CHANGED
|
@@ -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.
|
|
147
|
-
this.
|
|
148
|
-
this.
|
|
149
|
-
|
|
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(
|