@switchbot/homebridge-switchbot 3.5.0-beta.27 → 3.5.0-beta.28
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.js +2 -2
- package/dist/device/blindtilt.js.map +1 -1
- package/dist/device/bot.js +2 -2
- package/dist/device/bot.js.map +1 -1
- package/dist/device/ceilinglight.js +5 -5
- package/dist/device/ceilinglight.js.map +1 -1
- package/dist/device/colorbulb.js +1 -1
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/device/contact.js +1 -1
- package/dist/device/contact.js.map +1 -1
- package/dist/device/curtain.js +1 -1
- package/dist/device/curtain.js.map +1 -1
- package/dist/device/device.d.ts +2 -1
- package/dist/device/device.d.ts.map +1 -1
- package/dist/device/device.js +10 -3
- package/dist/device/device.js.map +1 -1
- package/dist/device/hub.js +1 -1
- package/dist/device/hub.js.map +1 -1
- package/dist/device/humidifier.js +1 -1
- package/dist/device/humidifier.js.map +1 -1
- package/dist/device/iosensor.js +1 -1
- package/dist/device/iosensor.js.map +1 -1
- package/dist/device/lightstrip.js +1 -1
- package/dist/device/lightstrip.js.map +1 -1
- package/dist/device/lock.js +1 -1
- package/dist/device/lock.js.map +1 -1
- package/dist/device/meter.js +1 -1
- package/dist/device/meter.js.map +1 -1
- package/dist/device/meterplus.js +1 -1
- package/dist/device/meterplus.js.map +1 -1
- package/dist/device/motion.js +1 -1
- package/dist/device/motion.js.map +1 -1
- package/dist/device/plug.js +1 -1
- package/dist/device/plug.js.map +1 -1
- package/dist/device/robotvacuumcleaner.js +2 -2
- package/dist/device/robotvacuumcleaner.js.map +1 -1
- package/dist/device/waterdetector.js +1 -1
- package/dist/device/waterdetector.js.map +1 -1
- package/dist/irdevice/airconditioner.js +1 -1
- package/dist/irdevice/airconditioner.js.map +1 -1
- package/dist/irdevice/airpurifier.js +1 -1
- package/dist/irdevice/airpurifier.js.map +1 -1
- package/dist/irdevice/camera.js +1 -1
- package/dist/irdevice/camera.js.map +1 -1
- package/dist/irdevice/fan.js +1 -1
- package/dist/irdevice/fan.js.map +1 -1
- package/dist/irdevice/irdevice.d.ts +2 -1
- package/dist/irdevice/irdevice.d.ts.map +1 -1
- package/dist/irdevice/irdevice.js +9 -2
- package/dist/irdevice/irdevice.js.map +1 -1
- package/dist/irdevice/light.js +1 -1
- package/dist/irdevice/light.js.map +1 -1
- package/dist/irdevice/other.js +1 -1
- package/dist/irdevice/other.js.map +1 -1
- package/dist/irdevice/tv.js +1 -1
- package/dist/irdevice/tv.js.map +1 -1
- package/dist/irdevice/vacuumcleaner.js +1 -1
- package/dist/irdevice/vacuumcleaner.js.map +1 -1
- package/dist/irdevice/waterheater.js +1 -1
- package/dist/irdevice/waterheater.js.map +1 -1
- package/package.json +1 -1
- package/src/device/blindtilt.ts +2 -2
- package/src/device/bot.ts +2 -2
- package/src/device/ceilinglight.ts +5 -5
- package/src/device/colorbulb.ts +1 -1
- package/src/device/contact.ts +1 -1
- package/src/device/curtain.ts +1 -1
- package/src/device/device.ts +11 -3
- package/src/device/hub.ts +1 -1
- package/src/device/humidifier.ts +1 -1
- package/src/device/iosensor.ts +1 -1
- package/src/device/lightstrip.ts +1 -1
- package/src/device/lock.ts +1 -1
- package/src/device/meter.ts +1 -1
- package/src/device/meterplus.ts +1 -1
- package/src/device/motion.ts +1 -1
- package/src/device/plug.ts +1 -1
- package/src/device/robotvacuumcleaner.ts +2 -2
- package/src/device/waterdetector.ts +1 -1
- package/src/irdevice/airconditioner.ts +1 -1
- package/src/irdevice/airpurifier.ts +1 -1
- package/src/irdevice/camera.ts +1 -1
- package/src/irdevice/fan.ts +1 -1
- package/src/irdevice/irdevice.ts +10 -2
- package/src/irdevice/light.ts +1 -1
- package/src/irdevice/other.ts +1 -1
- package/src/irdevice/tv.ts +1 -1
- package/src/irdevice/vacuumcleaner.ts +1 -1
- package/src/irdevice/waterheater.ts +1 -1
|
@@ -336,7 +336,7 @@ export class CeilingLight extends deviceBase {
|
|
|
336
336
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
337
337
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
338
338
|
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
339
|
-
this.
|
|
339
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
340
340
|
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
341
341
|
this.openAPIparseStatus(deviceStatus);
|
|
342
342
|
this.updateHomeKitCharacteristics();
|
|
@@ -465,7 +465,7 @@ export class CeilingLight extends deviceBase {
|
|
|
465
465
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
466
466
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
467
467
|
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
468
|
-
this.
|
|
468
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
469
469
|
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
470
470
|
this.successLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
471
471
|
+ `request to SwitchBot API, body: ${bodyChange} sent successfully`);
|
|
@@ -526,7 +526,7 @@ export class CeilingLight extends deviceBase {
|
|
|
526
526
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
527
527
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
528
528
|
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
529
|
-
this.
|
|
529
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
530
530
|
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
531
531
|
this.successLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
532
532
|
+ `request to SwitchBot API, body: ${bodyChange} sent successfully`);
|
|
@@ -572,7 +572,7 @@ export class CeilingLight extends deviceBase {
|
|
|
572
572
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
573
573
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
574
574
|
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
575
|
-
this.
|
|
575
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
576
576
|
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
577
577
|
} else {
|
|
578
578
|
this.statusCode(statusCode);
|
|
@@ -614,7 +614,7 @@ export class CeilingLight extends deviceBase {
|
|
|
614
614
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
615
615
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
616
616
|
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
617
|
-
this.
|
|
617
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
618
618
|
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
619
619
|
this.successLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
620
620
|
+ `request to SwitchBot API, body: ${bodyChange} sent successfully`);
|
package/src/device/colorbulb.ts
CHANGED
|
@@ -404,7 +404,7 @@ export class ColorBulb extends deviceBase {
|
|
|
404
404
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
405
405
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
406
406
|
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
407
|
-
this.
|
|
407
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
408
408
|
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
409
409
|
this.openAPIparseStatus(deviceStatus);
|
|
410
410
|
this.updateHomeKitCharacteristics();
|
package/src/device/contact.ts
CHANGED
|
@@ -348,7 +348,7 @@ export class Contact extends deviceBase {
|
|
|
348
348
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
349
349
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
350
350
|
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
351
|
-
this.
|
|
351
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
352
352
|
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
353
353
|
this.openAPIparseStatus(deviceStatus);
|
|
354
354
|
this.updateHomeKitCharacteristics();
|
package/src/device/curtain.ts
CHANGED
|
@@ -530,7 +530,7 @@ export class Curtain extends deviceBase {
|
|
|
530
530
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
531
531
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
532
532
|
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
533
|
-
this.
|
|
533
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
534
534
|
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
535
535
|
this.openAPIparseStatus(deviceStatus);
|
|
536
536
|
this.updateHomeKitCharacteristics();
|
package/src/device/device.ts
CHANGED
|
@@ -599,15 +599,23 @@ export abstract class deviceBase {
|
|
|
599
599
|
/**
|
|
600
600
|
* Logging for Device
|
|
601
601
|
*/
|
|
602
|
+
infoLog(...log: any[]): void {
|
|
603
|
+
if (this.enablingDeviceLogging()) {
|
|
604
|
+
this.log.info(String(...log));
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
|
|
602
608
|
successLog(...log: any[]): void {
|
|
603
609
|
if (this.enablingDeviceLogging()) {
|
|
604
|
-
this.
|
|
610
|
+
this.log.success(String(...log));
|
|
605
611
|
}
|
|
606
612
|
}
|
|
607
613
|
|
|
608
|
-
|
|
614
|
+
debugSuccessLog(...log: any[]): void {
|
|
609
615
|
if (this.enablingDeviceLogging()) {
|
|
610
|
-
this.
|
|
616
|
+
if (this.deviceLogging?.includes('debug')) {
|
|
617
|
+
this.log.success('[DEBUG]', String(...log));
|
|
618
|
+
}
|
|
611
619
|
}
|
|
612
620
|
}
|
|
613
621
|
|
package/src/device/hub.ts
CHANGED
|
@@ -240,7 +240,7 @@ export class Hub extends deviceBase {
|
|
|
240
240
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
241
241
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
242
242
|
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
243
|
-
this.
|
|
243
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
244
244
|
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
245
245
|
|
|
246
246
|
this.openAPIparseStatus(deviceStatus);
|
package/src/device/humidifier.ts
CHANGED
|
@@ -335,7 +335,7 @@ export class Humidifier extends deviceBase {
|
|
|
335
335
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
336
336
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
337
337
|
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
338
|
-
this.
|
|
338
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
339
339
|
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
340
340
|
this.openAPIparseStatus(deviceStatus);
|
|
341
341
|
this.updateHomeKitCharacteristics();
|
package/src/device/iosensor.ts
CHANGED
|
@@ -294,7 +294,7 @@ export class IOSensor extends deviceBase {
|
|
|
294
294
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
295
295
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
296
296
|
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
297
|
-
this.
|
|
297
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
298
298
|
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
299
299
|
this.openAPIparseStatus(deviceStatus);
|
|
300
300
|
this.updateHomeKitCharacteristics();
|
package/src/device/lightstrip.ts
CHANGED
|
@@ -366,7 +366,7 @@ export class StripLight extends deviceBase {
|
|
|
366
366
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
367
367
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
368
368
|
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
369
|
-
this.
|
|
369
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
370
370
|
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
371
371
|
this.openAPIparseStatus(deviceStatus);
|
|
372
372
|
this.updateHomeKitCharacteristics();
|
package/src/device/lock.ts
CHANGED
|
@@ -325,7 +325,7 @@ export class Lock extends deviceBase {
|
|
|
325
325
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
326
326
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
327
327
|
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
328
|
-
this.
|
|
328
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
329
329
|
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
330
330
|
this.openAPIparseStatus(deviceStatus);
|
|
331
331
|
this.updateHomeKitCharacteristics();
|
package/src/device/meter.ts
CHANGED
|
@@ -290,7 +290,7 @@ export class Meter extends deviceBase {
|
|
|
290
290
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
291
291
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
292
292
|
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
293
|
-
this.
|
|
293
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
294
294
|
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
295
295
|
this.openAPIparseStatus(deviceStatus);
|
|
296
296
|
this.updateHomeKitCharacteristics();
|
package/src/device/meterplus.ts
CHANGED
|
@@ -294,7 +294,7 @@ export class MeterPlus extends deviceBase {
|
|
|
294
294
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
295
295
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
296
296
|
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
297
|
-
this.
|
|
297
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
298
298
|
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
299
299
|
this.openAPIparseStatus(deviceStatus);
|
|
300
300
|
this.updateHomeKitCharacteristics();
|
package/src/device/motion.ts
CHANGED
|
@@ -269,7 +269,7 @@ export class Motion extends deviceBase {
|
|
|
269
269
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
270
270
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
271
271
|
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
272
|
-
this.
|
|
272
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
273
273
|
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
274
274
|
this.openAPIparseStatus(deviceStatus);
|
|
275
275
|
this.updateHomeKitCharacteristics();
|
package/src/device/plug.ts
CHANGED
|
@@ -199,7 +199,7 @@ export class Plug extends deviceBase {
|
|
|
199
199
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
200
200
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
201
201
|
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
202
|
-
this.
|
|
202
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
203
203
|
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
204
204
|
this.openAPIparseStatus(deviceStatus);
|
|
205
205
|
this.updateHomeKitCharacteristics();
|
|
@@ -317,7 +317,7 @@ export class RobotVacuumCleaner extends deviceBase {
|
|
|
317
317
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
318
318
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
319
319
|
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
320
|
-
this.
|
|
320
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
321
321
|
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
322
322
|
this.openAPIparseStatus(deviceStatus);
|
|
323
323
|
this.updateHomeKitCharacteristics();
|
|
@@ -471,7 +471,7 @@ export class RobotVacuumCleaner extends deviceBase {
|
|
|
471
471
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
472
472
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
473
473
|
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
474
|
-
this.
|
|
474
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
475
475
|
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
476
476
|
this.successLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
477
477
|
+ `request to SwitchBot API, body: ${deviceStatus} sent successfully`);
|
|
@@ -230,7 +230,7 @@ export class WaterDetector extends deviceBase {
|
|
|
230
230
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
231
231
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
232
232
|
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
233
|
-
this.
|
|
233
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
234
234
|
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
235
235
|
this.openAPIparseStatus(deviceStatus);
|
|
236
236
|
this.updateHomeKitCharacteristics();
|
|
@@ -346,7 +346,7 @@ export class AirConditioner extends irdeviceBase {
|
|
|
346
346
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
347
347
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
348
348
|
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
349
|
-
this.
|
|
349
|
+
this.debugSuccessLog(`${this.device.remoteType}: ${this.accessory.displayName} `
|
|
350
350
|
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
351
351
|
this.successLog(`${this.device.remoteType}: ${this.accessory.displayName} request to SwitchBot API, body: ${bodyChange} sent successfully`);
|
|
352
352
|
this.updateHomeKitCharacteristics();
|
|
@@ -222,7 +222,7 @@ export class AirPurifier extends irdeviceBase {
|
|
|
222
222
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
223
223
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
224
224
|
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
225
|
-
this.
|
|
225
|
+
this.debugSuccessLog(`${this.device.remoteType}: ${this.accessory.displayName} `
|
|
226
226
|
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
227
227
|
this.successLog(`${this.device.remoteType}: ${this.accessory.displayName} request to SwitchBot API, body: ${bodyChange} sent successfully`);
|
|
228
228
|
this.updateHomeKitCharacteristics();
|
package/src/irdevice/camera.ts
CHANGED
|
@@ -112,7 +112,7 @@ export class Camera extends irdeviceBase {
|
|
|
112
112
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
113
113
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
114
114
|
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
115
|
-
this.
|
|
115
|
+
this.debugSuccessLog(`${this.device.remoteType}: ${this.accessory.displayName} `
|
|
116
116
|
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
117
117
|
this.successLog(`${this.device.remoteType}: ${this.accessory.displayName} request to SwitchBot API, body: ${bodyChange} sent successfully`);
|
|
118
118
|
this.updateHomeKitCharacteristics();
|
package/src/irdevice/fan.ts
CHANGED
|
@@ -231,7 +231,7 @@ export class Fan extends irdeviceBase {
|
|
|
231
231
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
232
232
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
233
233
|
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
234
|
-
this.
|
|
234
|
+
this.debugSuccessLog(`${this.device.remoteType}: ${this.accessory.displayName} `
|
|
235
235
|
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
236
236
|
this.successLog(`${this.device.remoteType}: ${this.accessory.displayName} request to SwitchBot API, body: ${bodyChange} sent successfully`);
|
|
237
237
|
this.updateHomeKitCharacteristics();
|
package/src/irdevice/irdevice.ts
CHANGED
|
@@ -462,15 +462,23 @@ export abstract class irdeviceBase {
|
|
|
462
462
|
/**
|
|
463
463
|
* Logging for Device
|
|
464
464
|
*/
|
|
465
|
+
infoLog(...log: any[]): void {
|
|
466
|
+
if (this.enablingDeviceLogging()) {
|
|
467
|
+
this.log.info(String(...log));
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
|
|
465
471
|
successLog(...log: any[]): void {
|
|
466
472
|
if (this.enablingDeviceLogging()) {
|
|
467
473
|
this.platform.log.success(String(...log));
|
|
468
474
|
}
|
|
469
475
|
}
|
|
470
476
|
|
|
471
|
-
|
|
477
|
+
debugSuccessLog(...log: any[]): void {
|
|
472
478
|
if (this.enablingDeviceLogging()) {
|
|
473
|
-
this.
|
|
479
|
+
if (this.deviceLogging?.includes('debug')) {
|
|
480
|
+
this.log.success('[DEBUG]', String(...log));
|
|
481
|
+
}
|
|
474
482
|
}
|
|
475
483
|
}
|
|
476
484
|
|
package/src/irdevice/light.ts
CHANGED
|
@@ -223,7 +223,7 @@ export class Light extends irdeviceBase {
|
|
|
223
223
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
224
224
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
225
225
|
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
226
|
-
this.
|
|
226
|
+
this.debugSuccessLog(`${this.device.remoteType}: ${this.accessory.displayName} `
|
|
227
227
|
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
228
228
|
this.successLog(`${this.device.remoteType}: ${this.accessory.displayName} request to SwitchBot API, body: ${bodyChange} sent successfully`);
|
|
229
229
|
this.accessory.context.On = this.On;
|
package/src/irdevice/other.ts
CHANGED
|
@@ -491,7 +491,7 @@ export class Others extends irdeviceBase {
|
|
|
491
491
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
492
492
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
493
493
|
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
494
|
-
this.
|
|
494
|
+
this.debugSuccessLog(`${this.device.remoteType}: ${this.accessory.displayName} `
|
|
495
495
|
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
496
496
|
this.successLog(`${this.device.remoteType}: ${this.accessory.displayName} request to SwitchBot API, body: ${bodyChange} sent successfully`);
|
|
497
497
|
this.updateHomeKitCharacteristics();
|
package/src/irdevice/tv.ts
CHANGED
|
@@ -388,7 +388,7 @@ export class TV extends irdeviceBase {
|
|
|
388
388
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
389
389
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
390
390
|
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
391
|
-
this.
|
|
391
|
+
this.debugSuccessLog(`${this.device.remoteType}: ${this.accessory.displayName} `
|
|
392
392
|
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
393
393
|
this.successLog(`${this.device.remoteType}: ${this.accessory.displayName} request to SwitchBot API, body: ${bodyChange} sent successfully`);
|
|
394
394
|
this.updateHomeKitCharacteristics();
|
|
@@ -107,7 +107,7 @@ export class VacuumCleaner extends irdeviceBase {
|
|
|
107
107
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
108
108
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
109
109
|
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
110
|
-
this.
|
|
110
|
+
this.debugSuccessLog(`${this.device.remoteType}: ${this.accessory.displayName} `
|
|
111
111
|
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
112
112
|
this.successLog(`${this.device.remoteType}: ${this.accessory.displayName} request to SwitchBot API, body: ${bodyChange} sent successfully`);
|
|
113
113
|
this.updateHomeKitCharacteristics();
|
|
@@ -112,7 +112,7 @@ export class WaterHeater extends irdeviceBase {
|
|
|
112
112
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
113
113
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
114
114
|
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
115
|
-
this.
|
|
115
|
+
this.debugSuccessLog(`${this.device.remoteType}: ${this.accessory.displayName} `
|
|
116
116
|
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
117
117
|
this.successLog(`${this.device.remoteType}: ${this.accessory.displayName} request to SwitchBot API, body: ${bodyChange} sent successfully`);
|
|
118
118
|
this.updateHomeKitCharacteristics();
|