@switchbot/homebridge-switchbot 2.9.0-beta.2 → 2.9.0-beta.20
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/config.schema.json +14 -0
- package/dist/device/blindtilt.d.ts +1 -1
- package/dist/device/blindtilt.d.ts.map +1 -1
- package/dist/device/blindtilt.js +39 -18
- package/dist/device/blindtilt.js.map +1 -1
- package/dist/device/bot.d.ts +1 -1
- package/dist/device/bot.d.ts.map +1 -1
- package/dist/device/bot.js +73 -20
- package/dist/device/bot.js.map +1 -1
- package/dist/device/ceilinglight.d.ts +1 -1
- package/dist/device/ceilinglight.d.ts.map +1 -1
- package/dist/device/ceilinglight.js +35 -18
- package/dist/device/ceilinglight.js.map +1 -1
- package/dist/device/colorbulb.d.ts +1 -1
- package/dist/device/colorbulb.d.ts.map +1 -1
- package/dist/device/colorbulb.js +35 -18
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/device/contact.d.ts +1 -1
- package/dist/device/contact.d.ts.map +1 -1
- package/dist/device/contact.js +42 -18
- package/dist/device/contact.js.map +1 -1
- package/dist/device/curtain.d.ts +1 -1
- package/dist/device/curtain.d.ts.map +1 -1
- package/dist/device/curtain.js +39 -18
- package/dist/device/curtain.js.map +1 -1
- package/dist/device/hub.d.ts +1 -1
- package/dist/device/hub.d.ts.map +1 -1
- package/dist/device/hub.js +43 -18
- package/dist/device/hub.js.map +1 -1
- package/dist/device/humidifier.d.ts +1 -1
- package/dist/device/humidifier.d.ts.map +1 -1
- package/dist/device/humidifier.js +38 -18
- package/dist/device/humidifier.js.map +1 -1
- package/dist/device/iosensor.d.ts +1 -1
- package/dist/device/iosensor.d.ts.map +1 -1
- package/dist/device/iosensor.js +42 -19
- package/dist/device/iosensor.js.map +1 -1
- package/dist/device/lightstrip.d.ts +1 -1
- package/dist/device/lightstrip.d.ts.map +1 -1
- package/dist/device/lightstrip.js +35 -18
- package/dist/device/lightstrip.js.map +1 -1
- package/dist/device/lock.d.ts +1 -1
- package/dist/device/lock.d.ts.map +1 -1
- package/dist/device/lock.js +39 -18
- package/dist/device/lock.js.map +1 -1
- package/dist/device/meter.d.ts +1 -1
- package/dist/device/meter.d.ts.map +1 -1
- package/dist/device/meter.js +41 -18
- package/dist/device/meter.js.map +1 -1
- package/dist/device/meterplus.d.ts +3 -3
- package/dist/device/meterplus.d.ts.map +1 -1
- package/dist/device/meterplus.js +61 -38
- package/dist/device/meterplus.js.map +1 -1
- package/dist/device/motion.d.ts +1 -1
- package/dist/device/motion.d.ts.map +1 -1
- package/dist/device/motion.js +39 -18
- package/dist/device/motion.js.map +1 -1
- package/dist/device/plug.d.ts +1 -1
- package/dist/device/plug.d.ts.map +1 -1
- package/dist/device/plug.js +36 -18
- package/dist/device/plug.js.map +1 -1
- package/dist/device/robotvacuumcleaner.d.ts +1 -1
- package/dist/device/robotvacuumcleaner.d.ts.map +1 -1
- package/dist/device/robotvacuumcleaner.js +38 -17
- package/dist/device/robotvacuumcleaner.js.map +1 -1
- package/dist/irdevice/airconditioner.d.ts +1 -1
- package/dist/irdevice/airconditioner.d.ts.map +1 -1
- package/dist/irdevice/airconditioner.js +29 -15
- package/dist/irdevice/airconditioner.js.map +1 -1
- package/dist/irdevice/airpurifier.d.ts +1 -1
- package/dist/irdevice/airpurifier.d.ts.map +1 -1
- package/dist/irdevice/airpurifier.js +29 -15
- package/dist/irdevice/airpurifier.js.map +1 -1
- package/dist/irdevice/camera.d.ts +1 -1
- package/dist/irdevice/camera.d.ts.map +1 -1
- package/dist/irdevice/camera.js +29 -15
- 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 +29 -15
- package/dist/irdevice/fan.js.map +1 -1
- package/dist/irdevice/light.d.ts +1 -1
- package/dist/irdevice/light.d.ts.map +1 -1
- package/dist/irdevice/light.js +29 -15
- package/dist/irdevice/light.js.map +1 -1
- package/dist/irdevice/other.d.ts +1 -1
- package/dist/irdevice/other.d.ts.map +1 -1
- package/dist/irdevice/other.js +50 -23
- package/dist/irdevice/other.js.map +1 -1
- package/dist/irdevice/tv.d.ts +1 -1
- package/dist/irdevice/tv.d.ts.map +1 -1
- package/dist/irdevice/tv.js +29 -15
- package/dist/irdevice/tv.js.map +1 -1
- package/dist/irdevice/vacuumcleaner.d.ts +1 -1
- package/dist/irdevice/vacuumcleaner.d.ts.map +1 -1
- package/dist/irdevice/vacuumcleaner.js +29 -15
- package/dist/irdevice/vacuumcleaner.js.map +1 -1
- package/dist/irdevice/waterheater.d.ts +1 -1
- package/dist/irdevice/waterheater.d.ts.map +1 -1
- package/dist/irdevice/waterheater.js +29 -15
- package/dist/irdevice/waterheater.js.map +1 -1
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +4 -0
- package/dist/platform.js.map +1 -1
- package/dist/settings.d.ts +1 -0
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js.map +1 -1
- package/package.json +10 -10
- package/src/device/blindtilt.ts +39 -19
- package/src/device/bot.ts +63 -21
- package/src/device/ceilinglight.ts +35 -20
- package/src/device/colorbulb.ts +35 -19
- package/src/device/contact.ts +42 -20
- package/src/device/curtain.ts +39 -19
- package/src/device/hub.ts +44 -20
- package/src/device/humidifier.ts +38 -20
- package/src/device/iosensor.ts +42 -21
- package/src/device/lightstrip.ts +35 -19
- package/src/device/lock.ts +40 -21
- package/src/device/meter.ts +41 -19
- package/src/device/meterplus.ts +64 -41
- package/src/device/motion.ts +39 -21
- package/src/device/plug.ts +36 -20
- package/src/device/robotvacuumcleaner.ts +38 -19
- package/src/irdevice/airconditioner.ts +29 -16
- package/src/irdevice/airpurifier.ts +31 -16
- package/src/irdevice/camera.ts +31 -16
- package/src/irdevice/fan.ts +31 -16
- package/src/irdevice/light.ts +31 -16
- package/src/irdevice/other.ts +50 -24
- package/src/irdevice/tv.ts +31 -16
- package/src/irdevice/vacuumcleaner.ts +31 -16
- package/src/irdevice/waterheater.ts +31 -16
- package/src/platform.ts +4 -0
- package/src/settings.ts +1 -0
package/src/device/hub.ts
CHANGED
|
@@ -61,10 +61,20 @@ export class Hub {
|
|
|
61
61
|
.getService(this.platform.Service.AccessoryInformation)!
|
|
62
62
|
.setCharacteristic(this.platform.Characteristic.Manufacturer, 'SwitchBot')
|
|
63
63
|
.setCharacteristic(this.platform.Characteristic.Model, accessory.context.model)
|
|
64
|
-
.setCharacteristic(this.platform.Characteristic.SerialNumber, device.deviceId)
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
.
|
|
64
|
+
.setCharacteristic(this.platform.Characteristic.SerialNumber, device.deviceId!);
|
|
65
|
+
|
|
66
|
+
if (accessory.context.FirmwareRevision) {
|
|
67
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName}`
|
|
68
|
+
+ ` accessory.context.FirmwareRevision: ${accessory.context.FirmwareRevision}`);
|
|
69
|
+
accessory
|
|
70
|
+
.getService(this.platform.Service.AccessoryInformation)!
|
|
71
|
+
.setCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision)
|
|
72
|
+
.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision)
|
|
73
|
+
.getCharacteristic(this.platform.Characteristic.FirmwareRevision)
|
|
74
|
+
.updateValue(accessory.context.FirmwareRevision);
|
|
75
|
+
} else {
|
|
76
|
+
this.setFirmwareRevision(accessory, device);
|
|
77
|
+
}
|
|
68
78
|
|
|
69
79
|
// Temperature Sensor Service
|
|
70
80
|
if (device.hub?.hide_temperature) {
|
|
@@ -278,7 +288,7 @@ export class Hub {
|
|
|
278
288
|
}
|
|
279
289
|
|
|
280
290
|
// FirmwareRevision
|
|
281
|
-
this.FirmwareRevision =
|
|
291
|
+
this.FirmwareRevision = this.OpenAPI_FirmwareRevision!;
|
|
282
292
|
}
|
|
283
293
|
|
|
284
294
|
async refreshStatus(): Promise<void> {
|
|
@@ -388,8 +398,16 @@ export class Hub {
|
|
|
388
398
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} FirmwareRevision: ${this.FirmwareRevision}`);
|
|
389
399
|
} else {
|
|
390
400
|
this.accessory.context.FirmwareRevision = this.FirmwareRevision;
|
|
391
|
-
|
|
392
|
-
|
|
401
|
+
|
|
402
|
+
if (!this.device.hub?.hide_humidity) {
|
|
403
|
+
this.humidityService!.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.FirmwareRevision);
|
|
404
|
+
}
|
|
405
|
+
if (!this.device.hub?.hide_temperature) {
|
|
406
|
+
this.temperatureService!.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.FirmwareRevision);
|
|
407
|
+
}
|
|
408
|
+
if (!this.device.hub?.hide_lightsensor) {
|
|
409
|
+
this.lightSensorService!.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.FirmwareRevision);
|
|
410
|
+
}
|
|
393
411
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
394
412
|
+ `updateCharacteristic FirmwareRevision: ${this.FirmwareRevision}`);
|
|
395
413
|
}
|
|
@@ -473,24 +491,30 @@ export class Hub {
|
|
|
473
491
|
return this.set_maxLux;
|
|
474
492
|
}
|
|
475
493
|
|
|
476
|
-
setFirmwareRevision(accessory: PlatformAccessory<Context>, device: device & devicesConfig)
|
|
477
|
-
|
|
478
|
-
this.debugLog(
|
|
479
|
-
`${this.device.deviceType}: ${this.accessory.displayName}` + ` accessory.context.FirmwareRevision: ${accessory.context.FirmwareRevision}`,
|
|
480
|
-
);
|
|
481
|
-
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
482
|
-
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
494
|
+
async setFirmwareRevision(accessory: PlatformAccessory<Context>, device: device & devicesConfig) {
|
|
495
|
+
await this.refreshStatus();
|
|
483
496
|
if (device.firmware) {
|
|
484
|
-
this.
|
|
497
|
+
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
498
|
+
accessory.context.FirmwareRevision = device.firmware;
|
|
499
|
+
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
500
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} device.firmware, FirmwareRevision: ${this.FirmwareRevision}`);
|
|
485
501
|
} else if (device.version) {
|
|
486
|
-
this.
|
|
487
|
-
|
|
502
|
+
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} device.version: ${device.version}`);
|
|
503
|
+
accessory.context.FirmwareRevision = device.version;
|
|
488
504
|
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
505
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} device.version, FirmwareRevision: ${this.FirmwareRevision}`);
|
|
489
506
|
} else {
|
|
490
|
-
this.
|
|
507
|
+
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
508
|
+
accessory.context.FirmwareRevision = this.platform.version;
|
|
509
|
+
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
510
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} this.platform.version, FirmwareRevision: ${this.FirmwareRevision}`);
|
|
491
511
|
}
|
|
492
|
-
this.
|
|
493
|
-
|
|
512
|
+
this.infoLog(`${this.device.deviceType}: ${this.accessory.displayName} setFirmwareRevision: ${this.FirmwareRevision}`);
|
|
513
|
+
accessory
|
|
514
|
+
.getService(this.platform.Service.AccessoryInformation)!
|
|
515
|
+
.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision)
|
|
516
|
+
.getCharacteristic(this.platform.Characteristic.FirmwareRevision)
|
|
517
|
+
.updateValue(this.FirmwareRevision);
|
|
494
518
|
}
|
|
495
519
|
|
|
496
520
|
async refreshRate(device: device & devicesConfig): Promise<void> {
|
package/src/device/humidifier.ts
CHANGED
|
@@ -81,10 +81,20 @@ export class Humidifier {
|
|
|
81
81
|
.getService(this.platform.Service.AccessoryInformation)!
|
|
82
82
|
.setCharacteristic(this.platform.Characteristic.Manufacturer, 'SwitchBot')
|
|
83
83
|
.setCharacteristic(this.platform.Characteristic.Model, 'W0801800')
|
|
84
|
-
.setCharacteristic(this.platform.Characteristic.SerialNumber, device.deviceId!)
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
.
|
|
84
|
+
.setCharacteristic(this.platform.Characteristic.SerialNumber, device.deviceId!);
|
|
85
|
+
|
|
86
|
+
if (accessory.context.FirmwareRevision) {
|
|
87
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName}`
|
|
88
|
+
+ ` accessory.context.FirmwareRevision: ${accessory.context.FirmwareRevision}`);
|
|
89
|
+
accessory
|
|
90
|
+
.getService(this.platform.Service.AccessoryInformation)!
|
|
91
|
+
.setCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision)
|
|
92
|
+
.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision)
|
|
93
|
+
.getCharacteristic(this.platform.Characteristic.FirmwareRevision)
|
|
94
|
+
.updateValue(accessory.context.FirmwareRevision);
|
|
95
|
+
} else {
|
|
96
|
+
this.setFirmwareRevision(accessory, device);
|
|
97
|
+
}
|
|
88
98
|
|
|
89
99
|
// get the service if it exists, otherwise create a new service
|
|
90
100
|
// you can create multiple services for each accessory
|
|
@@ -283,7 +293,7 @@ export class Humidifier {
|
|
|
283
293
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} WaterLevel: ${this.WaterLevel}`);
|
|
284
294
|
|
|
285
295
|
// FirmwareRevision
|
|
286
|
-
this.FirmwareRevision =
|
|
296
|
+
this.FirmwareRevision = this.OpenAPI_FirmwareRevision!;
|
|
287
297
|
}
|
|
288
298
|
|
|
289
299
|
/**
|
|
@@ -743,8 +753,10 @@ export class Humidifier {
|
|
|
743
753
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} FirmwareRevision: ${this.FirmwareRevision}`);
|
|
744
754
|
} else {
|
|
745
755
|
this.accessory.context.FirmwareRevision = this.FirmwareRevision;
|
|
746
|
-
this.
|
|
747
|
-
|
|
756
|
+
this.humidifierService.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.FirmwareRevision);
|
|
757
|
+
if (!this.device.humidifier?.hide_temperature) {
|
|
758
|
+
this.temperatureservice!.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.FirmwareRevision);
|
|
759
|
+
}
|
|
748
760
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
749
761
|
+ `updateCharacteristic FirmwareRevision: ${this.FirmwareRevision}`);
|
|
750
762
|
}
|
|
@@ -883,24 +895,30 @@ export class Humidifier {
|
|
|
883
895
|
}
|
|
884
896
|
}
|
|
885
897
|
|
|
886
|
-
setFirmwareRevision(accessory: PlatformAccessory<Context>, device: device & devicesConfig)
|
|
887
|
-
|
|
888
|
-
this.debugLog(
|
|
889
|
-
`${this.device.deviceType}: ${this.accessory.displayName}` + ` accessory.context.FirmwareRevision: ${accessory.context.FirmwareRevision}`,
|
|
890
|
-
);
|
|
891
|
-
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
892
|
-
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
898
|
+
async setFirmwareRevision(accessory: PlatformAccessory<Context>, device: device & devicesConfig) {
|
|
899
|
+
await this.refreshStatus();
|
|
893
900
|
if (device.firmware) {
|
|
894
|
-
this.
|
|
901
|
+
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
902
|
+
accessory.context.FirmwareRevision = device.firmware;
|
|
903
|
+
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
904
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} device.firmware, FirmwareRevision: ${this.FirmwareRevision}`);
|
|
895
905
|
} else if (device.version) {
|
|
896
|
-
this.
|
|
897
|
-
|
|
906
|
+
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} device.version: ${device.version}`);
|
|
907
|
+
accessory.context.FirmwareRevision = device.version;
|
|
898
908
|
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
909
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} device.version, FirmwareRevision: ${this.FirmwareRevision}`);
|
|
899
910
|
} else {
|
|
900
|
-
this.
|
|
911
|
+
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
912
|
+
accessory.context.FirmwareRevision = this.platform.version;
|
|
913
|
+
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
914
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} this.platform.version, FirmwareRevision: ${this.FirmwareRevision}`);
|
|
901
915
|
}
|
|
902
|
-
this.
|
|
903
|
-
|
|
916
|
+
this.infoLog(`${this.device.deviceType}: ${this.accessory.displayName} setFirmwareRevision: ${this.FirmwareRevision}`);
|
|
917
|
+
accessory
|
|
918
|
+
.getService(this.platform.Service.AccessoryInformation)!
|
|
919
|
+
.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision)
|
|
920
|
+
.getCharacteristic(this.platform.Characteristic.FirmwareRevision)
|
|
921
|
+
.updateValue(this.FirmwareRevision);
|
|
904
922
|
}
|
|
905
923
|
|
|
906
924
|
async context() {
|
package/src/device/iosensor.ts
CHANGED
|
@@ -89,10 +89,20 @@ export class IOSensor {
|
|
|
89
89
|
.getService(this.platform.Service.AccessoryInformation)!
|
|
90
90
|
.setCharacteristic(this.platform.Characteristic.Manufacturer, 'SwitchBot')
|
|
91
91
|
.setCharacteristic(this.platform.Characteristic.Model, 'WoIOSensor')
|
|
92
|
-
.setCharacteristic(this.platform.Characteristic.SerialNumber, device.deviceId!)
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
.
|
|
92
|
+
.setCharacteristic(this.platform.Characteristic.SerialNumber, device.deviceId!);
|
|
93
|
+
|
|
94
|
+
if (accessory.context.FirmwareRevision) {
|
|
95
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName}`
|
|
96
|
+
+ ` accessory.context.FirmwareRevision: ${accessory.context.FirmwareRevision}`);
|
|
97
|
+
accessory
|
|
98
|
+
.getService(this.platform.Service.AccessoryInformation)!
|
|
99
|
+
.setCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision)
|
|
100
|
+
.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision)
|
|
101
|
+
.getCharacteristic(this.platform.Characteristic.FirmwareRevision)
|
|
102
|
+
.updateValue(accessory.context.FirmwareRevision);
|
|
103
|
+
} else {
|
|
104
|
+
this.setFirmwareRevision(accessory, device);
|
|
105
|
+
}
|
|
96
106
|
|
|
97
107
|
// Temperature Sensor Service
|
|
98
108
|
if (device.meter?.hide_temperature) {
|
|
@@ -254,7 +264,7 @@ export class IOSensor {
|
|
|
254
264
|
+ ` StatusLowBattery: ${this.StatusLowBattery}`);
|
|
255
265
|
|
|
256
266
|
// FirmwareRevision
|
|
257
|
-
this.FirmwareRevision =
|
|
267
|
+
this.FirmwareRevision = this.OpenAPI_FirmwareRevision!;
|
|
258
268
|
}
|
|
259
269
|
|
|
260
270
|
/**
|
|
@@ -290,7 +300,7 @@ export class IOSensor {
|
|
|
290
300
|
if (switchbot !== false) {
|
|
291
301
|
switchbot
|
|
292
302
|
.startScan({
|
|
293
|
-
model: '
|
|
303
|
+
model: 'w',
|
|
294
304
|
id: this.device.bleMac,
|
|
295
305
|
})
|
|
296
306
|
.then(async () => {
|
|
@@ -453,8 +463,13 @@ export class IOSensor {
|
|
|
453
463
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} FirmwareRevision: ${this.FirmwareRevision}`);
|
|
454
464
|
} else {
|
|
455
465
|
this.accessory.context.FirmwareRevision = this.FirmwareRevision;
|
|
456
|
-
this.
|
|
457
|
-
|
|
466
|
+
this.batteryService.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.FirmwareRevision);
|
|
467
|
+
if (this.device.meter?.hide_humidity) {
|
|
468
|
+
this.humidityservice!.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.FirmwareRevision);
|
|
469
|
+
}
|
|
470
|
+
if (this.device.meter?.hide_temperature) {
|
|
471
|
+
this.temperatureservice!.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.FirmwareRevision);
|
|
472
|
+
}
|
|
458
473
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
459
474
|
+ `updateCharacteristic FirmwareRevision: ${this.FirmwareRevision}`);
|
|
460
475
|
}
|
|
@@ -619,24 +634,30 @@ export class IOSensor {
|
|
|
619
634
|
this.batteryService?.updateCharacteristic(this.platform.Characteristic.StatusLowBattery, e);
|
|
620
635
|
}
|
|
621
636
|
|
|
622
|
-
setFirmwareRevision(accessory: PlatformAccessory<Context>, device: device & devicesConfig)
|
|
623
|
-
|
|
624
|
-
this.debugLog(
|
|
625
|
-
`${this.device.deviceType}: ${this.accessory.displayName}` + ` accessory.context.FirmwareRevision: ${accessory.context.FirmwareRevision}`,
|
|
626
|
-
);
|
|
627
|
-
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
628
|
-
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
637
|
+
async setFirmwareRevision(accessory: PlatformAccessory<Context>, device: device & devicesConfig) {
|
|
638
|
+
await this.refreshStatus();
|
|
629
639
|
if (device.firmware) {
|
|
630
|
-
this.
|
|
640
|
+
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
641
|
+
accessory.context.FirmwareRevision = device.firmware;
|
|
642
|
+
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
643
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} device.firmware, FirmwareRevision: ${this.FirmwareRevision}`);
|
|
631
644
|
} else if (device.version) {
|
|
632
|
-
this.
|
|
633
|
-
|
|
645
|
+
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} device.version: ${device.version}`);
|
|
646
|
+
accessory.context.FirmwareRevision = device.version;
|
|
634
647
|
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
648
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} device.version, FirmwareRevision: ${this.FirmwareRevision}`);
|
|
635
649
|
} else {
|
|
636
|
-
this.
|
|
650
|
+
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
651
|
+
accessory.context.FirmwareRevision = this.platform.version;
|
|
652
|
+
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
653
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} this.platform.version, FirmwareRevision: ${this.FirmwareRevision}`);
|
|
637
654
|
}
|
|
638
|
-
this.
|
|
639
|
-
|
|
655
|
+
this.infoLog(`${this.device.deviceType}: ${this.accessory.displayName} setFirmwareRevision: ${this.FirmwareRevision}`);
|
|
656
|
+
accessory
|
|
657
|
+
.getService(this.platform.Service.AccessoryInformation)!
|
|
658
|
+
.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision)
|
|
659
|
+
.getCharacteristic(this.platform.Characteristic.FirmwareRevision)
|
|
660
|
+
.updateValue(this.FirmwareRevision);
|
|
640
661
|
}
|
|
641
662
|
|
|
642
663
|
async context() {
|
package/src/device/lightstrip.ts
CHANGED
|
@@ -86,10 +86,20 @@ export class StripLight {
|
|
|
86
86
|
.getService(this.platform.Service.AccessoryInformation)!
|
|
87
87
|
.setCharacteristic(this.platform.Characteristic.Manufacturer, 'SwitchBot')
|
|
88
88
|
.setCharacteristic(this.platform.Characteristic.Model, 'W1701100')
|
|
89
|
-
.setCharacteristic(this.platform.Characteristic.SerialNumber, device.deviceId!)
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
.
|
|
89
|
+
.setCharacteristic(this.platform.Characteristic.SerialNumber, device.deviceId!);
|
|
90
|
+
|
|
91
|
+
if (accessory.context.FirmwareRevision) {
|
|
92
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName}`
|
|
93
|
+
+ ` accessory.context.FirmwareRevision: ${accessory.context.FirmwareRevision}`);
|
|
94
|
+
accessory
|
|
95
|
+
.getService(this.platform.Service.AccessoryInformation)!
|
|
96
|
+
.setCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision)
|
|
97
|
+
.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision)
|
|
98
|
+
.getCharacteristic(this.platform.Characteristic.FirmwareRevision)
|
|
99
|
+
.updateValue(accessory.context.FirmwareRevision);
|
|
100
|
+
} else {
|
|
101
|
+
this.setFirmwareRevision(accessory, device);
|
|
102
|
+
}
|
|
93
103
|
|
|
94
104
|
// get the Lightbulb service if it exists, otherwise create a new Lightbulb service
|
|
95
105
|
// you can create multiple services for each accessory
|
|
@@ -278,7 +288,7 @@ export class StripLight {
|
|
|
278
288
|
}
|
|
279
289
|
|
|
280
290
|
// FirmwareRevision
|
|
281
|
-
this.FirmwareRevision =
|
|
291
|
+
this.FirmwareRevision = this.OpenAPI_FirmwareRevision!;
|
|
282
292
|
}
|
|
283
293
|
|
|
284
294
|
/**
|
|
@@ -865,8 +875,7 @@ export class StripLight {
|
|
|
865
875
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} FirmwareRevision: ${this.FirmwareRevision}`);
|
|
866
876
|
} else {
|
|
867
877
|
this.accessory.context.FirmwareRevision = this.FirmwareRevision;
|
|
868
|
-
this.
|
|
869
|
-
.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.FirmwareRevision);
|
|
878
|
+
this.lightBulbService.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.FirmwareRevision);
|
|
870
879
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
871
880
|
+ `updateCharacteristic FirmwareRevision: ${this.FirmwareRevision}`);
|
|
872
881
|
}
|
|
@@ -1025,23 +1034,30 @@ export class StripLight {
|
|
|
1025
1034
|
this.lightBulbService.updateCharacteristic(this.platform.Characteristic.Saturation, e);
|
|
1026
1035
|
}
|
|
1027
1036
|
|
|
1028
|
-
setFirmwareRevision(accessory: PlatformAccessory<Context>, device: device & devicesConfig)
|
|
1029
|
-
this.
|
|
1030
|
-
`${this.device.deviceType}: ${this.accessory.displayName} ` + `accessory.context.FirmwareRevision: ${accessory.context.FirmwareRevision}`,
|
|
1031
|
-
);
|
|
1032
|
-
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
1033
|
-
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
1037
|
+
async setFirmwareRevision(accessory: PlatformAccessory<Context>, device: device & devicesConfig) {
|
|
1038
|
+
await this.refreshStatus();
|
|
1034
1039
|
if (device.firmware) {
|
|
1035
|
-
this.
|
|
1040
|
+
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
1041
|
+
accessory.context.FirmwareRevision = device.firmware;
|
|
1042
|
+
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
1043
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} device.firmware, FirmwareRevision: ${this.FirmwareRevision}`);
|
|
1036
1044
|
} else if (device.version) {
|
|
1037
|
-
this.
|
|
1038
|
-
|
|
1045
|
+
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} device.version: ${device.version}`);
|
|
1046
|
+
accessory.context.FirmwareRevision = device.version;
|
|
1039
1047
|
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
1048
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} device.version, FirmwareRevision: ${this.FirmwareRevision}`);
|
|
1040
1049
|
} else {
|
|
1041
|
-
this.
|
|
1050
|
+
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
1051
|
+
accessory.context.FirmwareRevision = this.platform.version;
|
|
1052
|
+
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
1053
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} this.platform.version, FirmwareRevision: ${this.FirmwareRevision}`);
|
|
1042
1054
|
}
|
|
1043
|
-
this.
|
|
1044
|
-
|
|
1055
|
+
this.infoLog(`${this.device.deviceType}: ${this.accessory.displayName} setFirmwareRevision: ${this.FirmwareRevision}`);
|
|
1056
|
+
accessory
|
|
1057
|
+
.getService(this.platform.Service.AccessoryInformation)!
|
|
1058
|
+
.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision)
|
|
1059
|
+
.getCharacteristic(this.platform.Characteristic.FirmwareRevision)
|
|
1060
|
+
.updateValue(this.FirmwareRevision);
|
|
1045
1061
|
}
|
|
1046
1062
|
|
|
1047
1063
|
async context() {
|
package/src/device/lock.ts
CHANGED
|
@@ -74,10 +74,20 @@ export class Lock {
|
|
|
74
74
|
.getService(this.platform.Service.AccessoryInformation)!
|
|
75
75
|
.setCharacteristic(this.platform.Characteristic.Manufacturer, 'SwitchBot')
|
|
76
76
|
.setCharacteristic(this.platform.Characteristic.Model, 'W1601700')
|
|
77
|
-
.setCharacteristic(this.platform.Characteristic.SerialNumber, device.deviceId!)
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
.
|
|
77
|
+
.setCharacteristic(this.platform.Characteristic.SerialNumber, device.deviceId!);
|
|
78
|
+
|
|
79
|
+
if (accessory.context.FirmwareRevision) {
|
|
80
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName}`
|
|
81
|
+
+ ` accessory.context.FirmwareRevision: ${accessory.context.FirmwareRevision}`);
|
|
82
|
+
accessory
|
|
83
|
+
.getService(this.platform.Service.AccessoryInformation)!
|
|
84
|
+
.setCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision)
|
|
85
|
+
.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision)
|
|
86
|
+
.getCharacteristic(this.platform.Characteristic.FirmwareRevision)
|
|
87
|
+
.updateValue(accessory.context.FirmwareRevision);
|
|
88
|
+
} else {
|
|
89
|
+
this.setFirmwareRevision(accessory, device);
|
|
90
|
+
}
|
|
81
91
|
|
|
82
92
|
// get the LockMechanism service if it exists, otherwise create a new LockMechanism service
|
|
83
93
|
// you can create multiple services for each accessory
|
|
@@ -237,10 +247,10 @@ export class Lock {
|
|
|
237
247
|
this.BatteryLevel = 100;
|
|
238
248
|
}
|
|
239
249
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} BatteryLevel: ${this.BatteryLevel},`
|
|
240
|
-
|
|
250
|
+
+ ` StatusLowBattery: ${this.StatusLowBattery}`);
|
|
241
251
|
|
|
242
252
|
// FirmwareRevision
|
|
243
|
-
this.FirmwareRevision =
|
|
253
|
+
this.FirmwareRevision = this.OpenAPI_FirmwareRevision!;
|
|
244
254
|
}
|
|
245
255
|
|
|
246
256
|
/**
|
|
@@ -538,8 +548,11 @@ export class Lock {
|
|
|
538
548
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} FirmwareRevision: ${this.FirmwareRevision}`);
|
|
539
549
|
} else {
|
|
540
550
|
this.accessory.context.FirmwareRevision = this.FirmwareRevision;
|
|
541
|
-
this.
|
|
542
|
-
|
|
551
|
+
this.lockService.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.FirmwareRevision);
|
|
552
|
+
this.batteryService.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.FirmwareRevision);
|
|
553
|
+
if (this.device.lock?.hide_contactsensor) {
|
|
554
|
+
this.contactSensorService!.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.FirmwareRevision);
|
|
555
|
+
}
|
|
543
556
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
544
557
|
+ `updateCharacteristic FirmwareRevision: ${this.FirmwareRevision}`);
|
|
545
558
|
}
|
|
@@ -659,24 +672,30 @@ export class Lock {
|
|
|
659
672
|
this.lockService.updateCharacteristic(this.platform.Characteristic.LockCurrentState, e);
|
|
660
673
|
}
|
|
661
674
|
|
|
662
|
-
setFirmwareRevision(accessory: PlatformAccessory<Context>, device: device & devicesConfig)
|
|
663
|
-
|
|
664
|
-
this.debugLog(
|
|
665
|
-
`${this.device.deviceType}: ${this.accessory.displayName}` + ` accessory.context.FirmwareRevision: ${accessory.context.FirmwareRevision}`,
|
|
666
|
-
);
|
|
667
|
-
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
668
|
-
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
675
|
+
async setFirmwareRevision(accessory: PlatformAccessory<Context>, device: device & devicesConfig) {
|
|
676
|
+
await this.refreshStatus();
|
|
669
677
|
if (device.firmware) {
|
|
670
|
-
this.
|
|
678
|
+
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
679
|
+
accessory.context.FirmwareRevision = device.firmware;
|
|
680
|
+
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
681
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} device.firmware, FirmwareRevision: ${this.FirmwareRevision}`);
|
|
671
682
|
} else if (device.version) {
|
|
672
|
-
this.
|
|
673
|
-
|
|
683
|
+
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} device.version: ${device.version}`);
|
|
684
|
+
accessory.context.FirmwareRevision = device.version;
|
|
674
685
|
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
686
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} device.version, FirmwareRevision: ${this.FirmwareRevision}`);
|
|
675
687
|
} else {
|
|
676
|
-
this.
|
|
688
|
+
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
689
|
+
accessory.context.FirmwareRevision = this.platform.version;
|
|
690
|
+
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
691
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} this.platform.version, FirmwareRevision: ${this.FirmwareRevision}`);
|
|
677
692
|
}
|
|
678
|
-
this.
|
|
679
|
-
|
|
693
|
+
this.infoLog(`${this.device.deviceType}: ${this.accessory.displayName} setFirmwareRevision: ${this.FirmwareRevision}`);
|
|
694
|
+
accessory
|
|
695
|
+
.getService(this.platform.Service.AccessoryInformation)!
|
|
696
|
+
.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision)
|
|
697
|
+
.getCharacteristic(this.platform.Characteristic.FirmwareRevision)
|
|
698
|
+
.updateValue(this.FirmwareRevision);
|
|
680
699
|
}
|
|
681
700
|
|
|
682
701
|
async context() {
|
package/src/device/meter.ts
CHANGED
|
@@ -89,10 +89,20 @@ export class Meter {
|
|
|
89
89
|
.getService(this.platform.Service.AccessoryInformation)!
|
|
90
90
|
.setCharacteristic(this.platform.Characteristic.Manufacturer, 'SwitchBot')
|
|
91
91
|
.setCharacteristic(this.platform.Characteristic.Model, 'METERTH-S1')
|
|
92
|
-
.setCharacteristic(this.platform.Characteristic.SerialNumber, device.deviceId!)
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
.
|
|
92
|
+
.setCharacteristic(this.platform.Characteristic.SerialNumber, device.deviceId!);
|
|
93
|
+
|
|
94
|
+
if (accessory.context.FirmwareRevision) {
|
|
95
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName}`
|
|
96
|
+
+ ` accessory.context.FirmwareRevision: ${accessory.context.FirmwareRevision}`);
|
|
97
|
+
accessory
|
|
98
|
+
.getService(this.platform.Service.AccessoryInformation)!
|
|
99
|
+
.setCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision)
|
|
100
|
+
.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision)
|
|
101
|
+
.getCharacteristic(this.platform.Characteristic.FirmwareRevision)
|
|
102
|
+
.updateValue(accessory.context.FirmwareRevision);
|
|
103
|
+
} else {
|
|
104
|
+
this.setFirmwareRevision(accessory, device);
|
|
105
|
+
}
|
|
96
106
|
|
|
97
107
|
// Temperature Sensor Service
|
|
98
108
|
if (device.meter?.hide_temperature) {
|
|
@@ -255,7 +265,7 @@ export class Meter {
|
|
|
255
265
|
+ ` StatusLowBattery: ${this.StatusLowBattery}`);
|
|
256
266
|
|
|
257
267
|
// FirmwareRevision
|
|
258
|
-
this.FirmwareRevision =
|
|
268
|
+
this.FirmwareRevision = this.OpenAPI_FirmwareRevision!;
|
|
259
269
|
}
|
|
260
270
|
|
|
261
271
|
/**
|
|
@@ -451,8 +461,13 @@ export class Meter {
|
|
|
451
461
|
mqttmessage.push(`"FirmwareRevision": ${this.FirmwareRevision}`);
|
|
452
462
|
}
|
|
453
463
|
this.accessory.context.FirmwareRevision = this.FirmwareRevision;
|
|
454
|
-
this.
|
|
455
|
-
|
|
464
|
+
this.batteryService.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.FirmwareRevision);
|
|
465
|
+
if (!this.device.meter?.hide_humidity) {
|
|
466
|
+
this.humidityService!.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.FirmwareRevision);
|
|
467
|
+
}
|
|
468
|
+
if (!this.device.meter?.hide_temperature) {
|
|
469
|
+
this.temperatureService!.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.FirmwareRevision);
|
|
470
|
+
}
|
|
456
471
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
457
472
|
+ `updateCharacteristic FirmwareRevision: ${this.FirmwareRevision}`);
|
|
458
473
|
}
|
|
@@ -628,23 +643,30 @@ export class Meter {
|
|
|
628
643
|
this.batteryService?.updateCharacteristic(this.platform.Characteristic.StatusLowBattery, e);
|
|
629
644
|
}
|
|
630
645
|
|
|
631
|
-
setFirmwareRevision(accessory: PlatformAccessory<Context>, device: device & devicesConfig)
|
|
632
|
-
this.
|
|
633
|
-
`${this.device.deviceType}: ${this.accessory.displayName}` + ` accessory.context.FirmwareRevision: ${accessory.context.FirmwareRevision}`,
|
|
634
|
-
);
|
|
635
|
-
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
636
|
-
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
646
|
+
async setFirmwareRevision(accessory: PlatformAccessory<Context>, device: device & devicesConfig) {
|
|
647
|
+
await this.refreshStatus();
|
|
637
648
|
if (device.firmware) {
|
|
638
|
-
this.
|
|
649
|
+
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
650
|
+
accessory.context.FirmwareRevision = device.firmware;
|
|
651
|
+
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
652
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} device.firmware, FirmwareRevision: ${this.FirmwareRevision}`);
|
|
639
653
|
} else if (device.version) {
|
|
640
|
-
this.
|
|
641
|
-
|
|
654
|
+
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} device.version: ${device.version}`);
|
|
655
|
+
accessory.context.FirmwareRevision = device.version;
|
|
642
656
|
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
657
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} device.version, FirmwareRevision: ${this.FirmwareRevision}`);
|
|
643
658
|
} else {
|
|
644
|
-
this.
|
|
659
|
+
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
660
|
+
accessory.context.FirmwareRevision = this.platform.version;
|
|
661
|
+
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
662
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} this.platform.version, FirmwareRevision: ${this.FirmwareRevision}`);
|
|
645
663
|
}
|
|
646
|
-
this.
|
|
647
|
-
|
|
664
|
+
this.infoLog(`${this.device.deviceType}: ${this.accessory.displayName} setFirmwareRevision: ${this.FirmwareRevision}`);
|
|
665
|
+
accessory
|
|
666
|
+
.getService(this.platform.Service.AccessoryInformation)!
|
|
667
|
+
.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision)
|
|
668
|
+
.getCharacteristic(this.platform.Characteristic.FirmwareRevision)
|
|
669
|
+
.updateValue(this.FirmwareRevision);
|
|
648
670
|
}
|
|
649
671
|
|
|
650
672
|
async context() {
|