@switchbot/homebridge-switchbot 3.5.0-beta.27 → 3.5.0-beta.29
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 +1 -0
- package/config.schema.json +67 -1
- package/dist/device/blindtilt.d.ts.map +1 -1
- package/dist/device/blindtilt.js +10 -5
- package/dist/device/blindtilt.js.map +1 -1
- package/dist/device/bot.d.ts.map +1 -1
- package/dist/device/bot.js +10 -5
- package/dist/device/bot.js.map +1 -1
- package/dist/device/ceilinglight.d.ts.map +1 -1
- package/dist/device/ceilinglight.js +36 -10
- package/dist/device/ceilinglight.js.map +1 -1
- package/dist/device/colorbulb.d.ts.map +1 -1
- package/dist/device/colorbulb.js +24 -5
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/device/contact.d.ts.map +1 -1
- package/dist/device/contact.js +8 -3
- package/dist/device/contact.js.map +1 -1
- package/dist/device/curtain.d.ts.map +1 -1
- package/dist/device/curtain.js +8 -3
- 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 +23 -6
- package/dist/device/device.js.map +1 -1
- package/dist/device/fan.d.ts +51 -0
- package/dist/device/fan.d.ts.map +1 -0
- package/dist/device/fan.js +499 -0
- package/dist/device/fan.js.map +1 -0
- package/dist/device/hub.d.ts.map +1 -1
- package/dist/device/hub.js +33 -25
- package/dist/device/hub.js.map +1 -1
- package/dist/device/humidifier.d.ts.map +1 -1
- package/dist/device/humidifier.js +8 -3
- package/dist/device/humidifier.js.map +1 -1
- package/dist/device/iosensor.d.ts.map +1 -1
- package/dist/device/iosensor.js +26 -18
- package/dist/device/iosensor.js.map +1 -1
- package/dist/device/lightstrip.d.ts.map +1 -1
- package/dist/device/lightstrip.js +42 -5
- package/dist/device/lightstrip.js.map +1 -1
- package/dist/device/lock.d.ts.map +1 -1
- package/dist/device/lock.js +8 -3
- package/dist/device/lock.js.map +1 -1
- package/dist/device/meter.d.ts.map +1 -1
- package/dist/device/meter.js +26 -18
- package/dist/device/meter.js.map +1 -1
- package/dist/device/meterplus.d.ts.map +1 -1
- package/dist/device/meterplus.js +8 -3
- package/dist/device/meterplus.js.map +1 -1
- package/dist/device/motion.d.ts.map +1 -1
- package/dist/device/motion.js +8 -3
- package/dist/device/motion.js.map +1 -1
- package/dist/device/plug.d.ts.map +1 -1
- package/dist/device/plug.js +8 -3
- package/dist/device/plug.js.map +1 -1
- package/dist/device/robotvacuumcleaner.d.ts.map +1 -1
- package/dist/device/robotvacuumcleaner.js +10 -5
- package/dist/device/robotvacuumcleaner.js.map +1 -1
- package/dist/device/waterdetector.d.ts.map +1 -1
- package/dist/device/waterdetector.js +15 -8
- package/dist/device/waterdetector.js.map +1 -1
- package/dist/irdevice/airconditioner.d.ts.map +1 -1
- package/dist/irdevice/airconditioner.js +3 -2
- package/dist/irdevice/airconditioner.js.map +1 -1
- package/dist/irdevice/airpurifier.d.ts.map +1 -1
- package/dist/irdevice/airpurifier.js +3 -2
- package/dist/irdevice/airpurifier.js.map +1 -1
- package/dist/irdevice/camera.d.ts.map +1 -1
- package/dist/irdevice/camera.js +3 -2
- package/dist/irdevice/camera.js.map +1 -1
- package/dist/irdevice/fan.d.ts +1 -1
- package/dist/irdevice/fan.d.ts.map +1 -1
- package/dist/irdevice/fan.js +4 -3
- 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.d.ts.map +1 -1
- package/dist/irdevice/light.js +3 -2
- package/dist/irdevice/light.js.map +1 -1
- package/dist/irdevice/other.d.ts.map +1 -1
- package/dist/irdevice/other.js +3 -2
- package/dist/irdevice/other.js.map +1 -1
- package/dist/irdevice/tv.d.ts.map +1 -1
- package/dist/irdevice/tv.js +3 -2
- package/dist/irdevice/tv.js.map +1 -1
- package/dist/irdevice/vacuumcleaner.d.ts.map +1 -1
- package/dist/irdevice/vacuumcleaner.js +3 -2
- package/dist/irdevice/vacuumcleaner.js.map +1 -1
- package/dist/irdevice/waterheater.d.ts.map +1 -1
- package/dist/irdevice/waterheater.js +3 -2
- package/dist/irdevice/waterheater.js.map +1 -1
- package/dist/platform.d.ts +2 -1
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +68 -5
- package/dist/platform.js.map +1 -1
- package/dist/settings.d.ts +22 -4
- package/dist/settings.d.ts.map +1 -1
- package/dist/utils.d.ts +10 -5
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +23 -9
- package/dist/utils.js.map +1 -1
- package/package.json +3 -3
- package/src/device/blindtilt.ts +10 -5
- package/src/device/bot.ts +10 -5
- package/src/device/ceilinglight.ts +36 -10
- package/src/device/colorbulb.ts +26 -7
- package/src/device/contact.ts +10 -5
- package/src/device/curtain.ts +22 -17
- package/src/device/device.ts +24 -6
- package/src/device/fan.ts +548 -0
- package/src/device/hub.ts +31 -23
- package/src/device/humidifier.ts +9 -4
- package/src/device/iosensor.ts +28 -20
- package/src/device/lightstrip.ts +41 -7
- package/src/device/lock.ts +13 -8
- package/src/device/meter.ts +30 -22
- package/src/device/meterplus.ts +12 -7
- package/src/device/motion.ts +9 -4
- package/src/device/plug.ts +9 -4
- package/src/device/robotvacuumcleaner.ts +15 -10
- package/src/device/waterdetector.ts +15 -8
- package/src/irdevice/airconditioner.ts +5 -4
- package/src/irdevice/airpurifier.ts +5 -4
- package/src/irdevice/camera.ts +4 -3
- package/src/irdevice/fan.ts +4 -3
- package/src/irdevice/irdevice.ts +11 -3
- package/src/irdevice/light.ts +3 -2
- package/src/irdevice/other.ts +47 -46
- package/src/irdevice/tv.ts +3 -2
- package/src/irdevice/vacuumcleaner.ts +3 -2
- package/src/irdevice/waterheater.ts +3 -2
- package/src/platform.ts +71 -5
- package/src/settings.ts +34 -9
- package/src/utils.ts +24 -9
package/src/device/contact.ts
CHANGED
|
@@ -136,8 +136,8 @@ export class Contact extends deviceBase {
|
|
|
136
136
|
});
|
|
137
137
|
|
|
138
138
|
//regisiter webhook event handler
|
|
139
|
-
if (
|
|
140
|
-
this.
|
|
139
|
+
if (device.webhook) {
|
|
140
|
+
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} is listening webhook.`);
|
|
141
141
|
this.platform.webhookEventHandler[this.device.deviceId] = async (context) => {
|
|
142
142
|
try {
|
|
143
143
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} received Webhook: ${JSON.stringify(context)}`);
|
|
@@ -280,6 +280,11 @@ export class Contact extends deviceBase {
|
|
|
280
280
|
|
|
281
281
|
// FirmwareRevision
|
|
282
282
|
this.accessory.context.FirmwareRevision = deviceStatus.body.version;
|
|
283
|
+
this.accessory
|
|
284
|
+
.getService(this.hap.Service.AccessoryInformation)!
|
|
285
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, this.accessory.context.FirmwareRevision)
|
|
286
|
+
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
287
|
+
.updateValue(this.accessory.context.FirmwareRevision);
|
|
283
288
|
}
|
|
284
289
|
|
|
285
290
|
/**
|
|
@@ -348,7 +353,7 @@ export class Contact extends deviceBase {
|
|
|
348
353
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
349
354
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
350
355
|
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
351
|
-
this.
|
|
356
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
352
357
|
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
353
358
|
this.openAPIparseStatus(deviceStatus);
|
|
354
359
|
this.updateHomeKitCharacteristics();
|
|
@@ -454,10 +459,10 @@ export class Contact extends deviceBase {
|
|
|
454
459
|
this.ContactSensor.Service.updateCharacteristic(this.hap.Characteristic.ContactSensorState,
|
|
455
460
|
this.hap.Characteristic.ContactSensorState.CONTACT_DETECTED);
|
|
456
461
|
if (!this.device.contact?.hide_motionsensor) {
|
|
457
|
-
|
|
462
|
+
this.MotionSensor!.Service.updateCharacteristic(this.hap.Characteristic.MotionDetected, false);
|
|
458
463
|
}
|
|
459
464
|
if (!this.device.contact?.hide_lightsensor) {
|
|
460
|
-
|
|
465
|
+
this.LightSensor!.Service.updateCharacteristic(this.hap.Characteristic.CurrentAmbientLightLevel, 100);
|
|
461
466
|
}
|
|
462
467
|
}
|
|
463
468
|
}
|
package/src/device/curtain.ts
CHANGED
|
@@ -154,8 +154,8 @@ export class Curtain extends deviceBase {
|
|
|
154
154
|
});
|
|
155
155
|
|
|
156
156
|
//regisiter webhook event handler
|
|
157
|
-
if (
|
|
158
|
-
this.
|
|
157
|
+
if (device.webhook) {
|
|
158
|
+
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} is listening webhook.`);
|
|
159
159
|
this.platform.webhookEventHandler[this.device.deviceId] = async (context) => {
|
|
160
160
|
try {
|
|
161
161
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} received Webhook: ${JSON.stringify(context)}`);
|
|
@@ -408,20 +408,20 @@ export class Curtain extends deviceBase {
|
|
|
408
408
|
this.WindowCovering.PositionState = this.hap.Characteristic.PositionState.INCREASING;
|
|
409
409
|
this.WindowCovering.Service.getCharacteristic(this.hap.Characteristic.PositionState).updateValue(this.WindowCovering.PositionState);
|
|
410
410
|
this.debugLog(`${this.device.deviceType}: ${this.WindowCovering.CurrentPosition} INCREASING`
|
|
411
|
-
|
|
411
|
+
+ ` PositionState: ${this.WindowCovering.PositionState}`);
|
|
412
412
|
} else if (Number(this.WindowCovering.TargetPosition) < this.WindowCovering.CurrentPosition) {
|
|
413
413
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Opening, CurrentPosition: ${this.WindowCovering.CurrentPosition} `);
|
|
414
414
|
this.WindowCovering.PositionState = this.hap.Characteristic.PositionState.DECREASING;
|
|
415
415
|
this.WindowCovering.Service.getCharacteristic(this.hap.Characteristic.PositionState).updateValue(this.WindowCovering.PositionState);
|
|
416
416
|
this.debugLog(`${this.device.deviceType}: ${this.WindowCovering.CurrentPosition} DECREASING`
|
|
417
|
-
|
|
417
|
+
+ ` PositionState: ${this.WindowCovering.PositionState}`);
|
|
418
418
|
} else {
|
|
419
419
|
this.debugLog(`${this.device.deviceType}: ${this.WindowCovering.CurrentPosition} Standby,`
|
|
420
|
-
|
|
420
|
+
+ ` CurrentPosition: ${this.WindowCovering.CurrentPosition}`);
|
|
421
421
|
this.WindowCovering.PositionState = this.hap.Characteristic.PositionState.STOPPED;
|
|
422
422
|
this.WindowCovering.Service.getCharacteristic(this.hap.Characteristic.PositionState).updateValue(this.WindowCovering.PositionState);
|
|
423
423
|
this.debugLog(`${this.device.deviceType}: ${this.WindowCovering.CurrentPosition} STOPPED`
|
|
424
|
-
|
|
424
|
+
+ ` PositionState: ${this.WindowCovering.PositionState}`);
|
|
425
425
|
}
|
|
426
426
|
} else {
|
|
427
427
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Standby, CurrentPosition: ${this.WindowCovering.CurrentPosition}`);
|
|
@@ -447,7 +447,7 @@ export class Curtain extends deviceBase {
|
|
|
447
447
|
this.LightSensor!.CurrentAmbientLightLevel = set_maxLux;
|
|
448
448
|
}
|
|
449
449
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName}`
|
|
450
|
-
|
|
450
|
+
+ ` CurrentAmbientLightLevel: ${this.LightSensor!.CurrentAmbientLightLevel}`);
|
|
451
451
|
}
|
|
452
452
|
|
|
453
453
|
// BatteryLevel
|
|
@@ -465,6 +465,11 @@ export class Curtain extends deviceBase {
|
|
|
465
465
|
|
|
466
466
|
// FirmwareRevision
|
|
467
467
|
this.accessory.context.FirmwareRevision = deviceStatus.body.version;
|
|
468
|
+
this.accessory
|
|
469
|
+
.getService(this.hap.Service.AccessoryInformation)!
|
|
470
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, this.accessory.context.FirmwareRevision)
|
|
471
|
+
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
472
|
+
.updateValue(this.accessory.context.FirmwareRevision);
|
|
468
473
|
}
|
|
469
474
|
|
|
470
475
|
async refreshStatus(): Promise<void> {
|
|
@@ -530,7 +535,7 @@ export class Curtain extends deviceBase {
|
|
|
530
535
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
531
536
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
532
537
|
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
533
|
-
this.
|
|
538
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
534
539
|
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
535
540
|
this.openAPIparseStatus(deviceStatus);
|
|
536
541
|
this.updateHomeKitCharacteristics();
|
|
@@ -704,17 +709,17 @@ export class Curtain extends deviceBase {
|
|
|
704
709
|
this.WindowCovering.PositionState = this.hap.Characteristic.PositionState.INCREASING;
|
|
705
710
|
this.setNewTarget = true;
|
|
706
711
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} value: ${value},`
|
|
707
|
-
|
|
712
|
+
+ ` CurrentPosition: ${this.WindowCovering.CurrentPosition}`);
|
|
708
713
|
} else if (value < this.WindowCovering.CurrentPosition) {
|
|
709
714
|
this.WindowCovering.PositionState = this.hap.Characteristic.PositionState.DECREASING;
|
|
710
715
|
this.setNewTarget = true;
|
|
711
716
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} value: ${value},`
|
|
712
|
-
|
|
717
|
+
+ ` CurrentPosition: ${this.WindowCovering.CurrentPosition}`);
|
|
713
718
|
} else {
|
|
714
719
|
this.WindowCovering.PositionState = this.hap.Characteristic.PositionState.STOPPED;
|
|
715
720
|
this.setNewTarget = false;
|
|
716
721
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} value: ${value},`
|
|
717
|
-
|
|
722
|
+
+ ` CurrentPosition: ${this.WindowCovering.CurrentPosition}`);
|
|
718
723
|
}
|
|
719
724
|
this.WindowCovering.Service.setCharacteristic(this.hap.Characteristic.PositionState, this.WindowCovering.PositionState);
|
|
720
725
|
this.WindowCovering.Service.getCharacteristic(this.hap.Characteristic.PositionState).updateValue(this.WindowCovering.PositionState);
|
|
@@ -751,7 +756,7 @@ export class Curtain extends deviceBase {
|
|
|
751
756
|
this.accessory.context.CurrentPosition = this.WindowCovering.CurrentPosition;
|
|
752
757
|
this.WindowCovering.Service.updateCharacteristic(this.hap.Characteristic.CurrentPosition, Number(this.WindowCovering.CurrentPosition));
|
|
753
758
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} updateCharacteristic`
|
|
754
|
-
|
|
759
|
+
+ ` CurrentPosition: ${this.WindowCovering.CurrentPosition}`);
|
|
755
760
|
if (this.device.mqttURL) {
|
|
756
761
|
this.mqttPublish('CurrentPosition', this.WindowCovering.CurrentPosition.toString()); // Convert to string
|
|
757
762
|
}
|
|
@@ -765,7 +770,7 @@ export class Curtain extends deviceBase {
|
|
|
765
770
|
this.accessory.context.PositionState = this.WindowCovering.PositionState;
|
|
766
771
|
this.WindowCovering.Service.updateCharacteristic(this.hap.Characteristic.PositionState, Number(this.WindowCovering.PositionState));
|
|
767
772
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} updateCharacteristic`
|
|
768
|
-
|
|
773
|
+
+ ` PositionState: ${this.WindowCovering.PositionState}`);
|
|
769
774
|
}
|
|
770
775
|
if (this.WindowCovering.TargetPosition === undefined || Number.isNaN(this.WindowCovering.TargetPosition)) {
|
|
771
776
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} TargetPosition: ${this.WindowCovering.TargetPosition}`);
|
|
@@ -776,7 +781,7 @@ export class Curtain extends deviceBase {
|
|
|
776
781
|
this.accessory.context.TargetPosition = this.WindowCovering.TargetPosition;
|
|
777
782
|
this.WindowCovering.Service.updateCharacteristic(this.hap.Characteristic.TargetPosition, Number(this.WindowCovering.TargetPosition));
|
|
778
783
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} updateCharacteristic`
|
|
779
|
-
|
|
784
|
+
+ ` TargetPosition: ${this.WindowCovering.TargetPosition}`);
|
|
780
785
|
}
|
|
781
786
|
if (this.WindowCovering.HoldPosition === undefined) {
|
|
782
787
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} HoldPosition: ${this.WindowCovering.HoldPosition}`);
|
|
@@ -787,12 +792,12 @@ export class Curtain extends deviceBase {
|
|
|
787
792
|
this.accessory.context.HoldPosition = this.WindowCovering.HoldPosition;
|
|
788
793
|
this.WindowCovering.Service.updateCharacteristic(this.hap.Characteristic.HoldPosition, this.WindowCovering.HoldPosition);
|
|
789
794
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} updateCharacteristic`
|
|
790
|
-
|
|
795
|
+
+ ` HoldPosition: ${this.WindowCovering.HoldPosition}`);
|
|
791
796
|
}
|
|
792
797
|
if (!this.device.curtain?.hide_lightsensor) {
|
|
793
798
|
if (this.LightSensor!.CurrentAmbientLightLevel === undefined || Number.isNaN(this.LightSensor!.CurrentAmbientLightLevel)) {
|
|
794
799
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName}`
|
|
795
|
-
|
|
800
|
+
+ ` CurrentAmbientLightLevel: ${this.LightSensor!.CurrentAmbientLightLevel}`);
|
|
796
801
|
} else {
|
|
797
802
|
if (this.device.mqttURL) {
|
|
798
803
|
this.mqttPublish('CurrentAmbientLightLevel', this.LightSensor!.CurrentAmbientLightLevel.toString());
|
|
@@ -830,7 +835,7 @@ export class Curtain extends deviceBase {
|
|
|
830
835
|
this.accessory.context.StatusLowBattery = this.Battery.StatusLowBattery;
|
|
831
836
|
this.Battery.Service.updateCharacteristic(this.hap.Characteristic.StatusLowBattery, this.Battery.StatusLowBattery);
|
|
832
837
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} updateCharacteristic`
|
|
833
|
-
|
|
838
|
+
+ ` StatusLowBattery: ${this.Battery.StatusLowBattery}`);
|
|
834
839
|
}
|
|
835
840
|
}
|
|
836
841
|
|
package/src/device/device.ts
CHANGED
|
@@ -195,13 +195,13 @@ export abstract class deviceBase {
|
|
|
195
195
|
if (device.offline !== undefined) {
|
|
196
196
|
config['offline'] = device.offline;
|
|
197
197
|
}
|
|
198
|
-
if (device.maxRetry !==
|
|
198
|
+
if (device.maxRetry !== 0 ) {
|
|
199
199
|
config['maxRetry'] = device.maxRetry;
|
|
200
200
|
}
|
|
201
|
-
if (device.webhook
|
|
201
|
+
if (device.webhook === true) {
|
|
202
202
|
config['webhook'] = device.webhook;
|
|
203
203
|
}
|
|
204
|
-
if (device.connectionType
|
|
204
|
+
if (device.connectionType) {
|
|
205
205
|
config['connectionType'] = device.connectionType;
|
|
206
206
|
}
|
|
207
207
|
if (device.external !== undefined) {
|
|
@@ -479,6 +479,11 @@ export abstract class deviceBase {
|
|
|
479
479
|
device.bleModel = SwitchBotBLEModel.Unknown;
|
|
480
480
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Model: ${device.model}, BLE Model: ${device.bleModel}`);
|
|
481
481
|
break;
|
|
482
|
+
case 'Robot Vacuum Cleaner S10':
|
|
483
|
+
device.model = SwitchBotModel.RobotVacuumCleanerS10;
|
|
484
|
+
device.bleModel = SwitchBotBLEModel.Unknown;
|
|
485
|
+
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Model: ${device.model}, BLE Model: ${device.bleModel}`);
|
|
486
|
+
break;
|
|
482
487
|
case 'Ceiling Light':
|
|
483
488
|
device.model = SwitchBotModel.CeilingLight;
|
|
484
489
|
device.bleModel = SwitchBotBLEModel.CeilingLight;
|
|
@@ -509,6 +514,11 @@ export abstract class deviceBase {
|
|
|
509
514
|
device.bleModel = SwitchBotBLEModel.Unknown;
|
|
510
515
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Model: ${device.model}, BLE Model: ${device.bleModel}`);
|
|
511
516
|
break;
|
|
517
|
+
case 'Battery Circulator Fan':
|
|
518
|
+
device.model = SwitchBotModel.BatteryCirculatorFan;
|
|
519
|
+
device.bleModel = SwitchBotBLEModel.Unknown;
|
|
520
|
+
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Model: ${device.model}, BLE Model: ${device.bleModel}`);
|
|
521
|
+
break;
|
|
512
522
|
default:
|
|
513
523
|
device.model = SwitchBotModel.Unknown;
|
|
514
524
|
device.bleModel = SwitchBotBLEModel.Unknown;
|
|
@@ -599,15 +609,23 @@ export abstract class deviceBase {
|
|
|
599
609
|
/**
|
|
600
610
|
* Logging for Device
|
|
601
611
|
*/
|
|
612
|
+
infoLog(...log: any[]): void {
|
|
613
|
+
if (this.enablingDeviceLogging()) {
|
|
614
|
+
this.log.info(String(...log));
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
|
|
602
618
|
successLog(...log: any[]): void {
|
|
603
619
|
if (this.enablingDeviceLogging()) {
|
|
604
|
-
this.
|
|
620
|
+
this.log.success(String(...log));
|
|
605
621
|
}
|
|
606
622
|
}
|
|
607
623
|
|
|
608
|
-
|
|
624
|
+
debugSuccessLog(...log: any[]): void {
|
|
609
625
|
if (this.enablingDeviceLogging()) {
|
|
610
|
-
this.
|
|
626
|
+
if (this.deviceLogging?.includes('debug')) {
|
|
627
|
+
this.log.success('[DEBUG]', String(...log));
|
|
628
|
+
}
|
|
611
629
|
}
|
|
612
630
|
}
|
|
613
631
|
|