@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/meterplus.ts
CHANGED
|
@@ -18,8 +18,8 @@ import { sleep } from '../utils';
|
|
|
18
18
|
export class MeterPlus {
|
|
19
19
|
// Services
|
|
20
20
|
batteryService: Service;
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
humidityService?: Service;
|
|
22
|
+
temperatureService?: Service;
|
|
23
23
|
|
|
24
24
|
// Characteristic Values
|
|
25
25
|
BatteryLevel!: CharacteristicValue;
|
|
@@ -89,27 +89,37 @@ export class MeterPlus {
|
|
|
89
89
|
.getService(this.platform.Service.AccessoryInformation)!
|
|
90
90
|
.setCharacteristic(this.platform.Characteristic.Manufacturer, 'SwitchBot')
|
|
91
91
|
.setCharacteristic(this.platform.Characteristic.Model, this.model(device))
|
|
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) {
|
|
99
109
|
this.debugLog(`${this.device.deviceType}: ${accessory.displayName} Removing Temperature Sensor Service`);
|
|
100
|
-
this.
|
|
101
|
-
accessory.removeService(this.
|
|
102
|
-
} else if (!this.
|
|
110
|
+
this.temperatureService = this.accessory.getService(this.platform.Service.TemperatureSensor);
|
|
111
|
+
accessory.removeService(this.temperatureService!);
|
|
112
|
+
} else if (!this.temperatureService) {
|
|
103
113
|
this.debugLog(`${this.device.deviceType}: ${accessory.displayName} Add Temperature Sensor Service`);
|
|
104
|
-
(this.
|
|
114
|
+
(this.temperatureService =
|
|
105
115
|
this.accessory.getService(this.platform.Service.TemperatureSensor) || this.accessory.addService(this.platform.Service.TemperatureSensor)),
|
|
106
116
|
`${accessory.displayName} Temperature Sensor`;
|
|
107
117
|
|
|
108
|
-
this.
|
|
109
|
-
if (!this.
|
|
110
|
-
this.
|
|
118
|
+
this.temperatureService.setCharacteristic(this.platform.Characteristic.Name, `${accessory.displayName} Temperature Sensor`);
|
|
119
|
+
if (!this.temperatureService.testCharacteristic(this.platform.Characteristic.ConfiguredName)) {
|
|
120
|
+
this.temperatureService.addCharacteristic(this.platform.Characteristic.ConfiguredName, `${accessory.displayName} Temperature Sensor`);
|
|
111
121
|
}
|
|
112
|
-
this.
|
|
122
|
+
this.temperatureService
|
|
113
123
|
.getCharacteristic(this.platform.Characteristic.CurrentTemperature)
|
|
114
124
|
.setProps({
|
|
115
125
|
unit: Units['CELSIUS'],
|
|
@@ -128,19 +138,19 @@ export class MeterPlus {
|
|
|
128
138
|
// Humidity Sensor Service
|
|
129
139
|
if (device.meter?.hide_humidity) {
|
|
130
140
|
this.debugLog(`${this.device.deviceType}: ${accessory.displayName} Removing Humidity Sensor Service`);
|
|
131
|
-
this.
|
|
132
|
-
accessory.removeService(this.
|
|
133
|
-
} else if (!this.
|
|
141
|
+
this.humidityService = this.accessory.getService(this.platform.Service.HumiditySensor);
|
|
142
|
+
accessory.removeService(this.humidityService!);
|
|
143
|
+
} else if (!this.humidityService) {
|
|
134
144
|
this.debugLog(`${this.device.deviceType}: ${accessory.displayName} Add Humidity Sensor Service`);
|
|
135
|
-
(this.
|
|
145
|
+
(this.humidityService =
|
|
136
146
|
this.accessory.getService(this.platform.Service.HumiditySensor) || this.accessory.addService(this.platform.Service.HumiditySensor)),
|
|
137
147
|
`${accessory.displayName} Humidity Sensor`;
|
|
138
148
|
|
|
139
|
-
this.
|
|
140
|
-
if (!this.
|
|
141
|
-
this.
|
|
149
|
+
this.humidityService.setCharacteristic(this.platform.Characteristic.Name, `${accessory.displayName} Humidity Sensor`);
|
|
150
|
+
if (!this.humidityService.testCharacteristic(this.platform.Characteristic.ConfiguredName)) {
|
|
151
|
+
this.humidityService.addCharacteristic(this.platform.Characteristic.ConfiguredName, `${accessory.displayName} Humidity Sensor`);
|
|
142
152
|
}
|
|
143
|
-
this.
|
|
153
|
+
this.humidityService
|
|
144
154
|
.getCharacteristic(this.platform.Characteristic.CurrentRelativeHumidity)
|
|
145
155
|
.setProps({
|
|
146
156
|
minStep: 0.1,
|
|
@@ -255,7 +265,7 @@ export class MeterPlus {
|
|
|
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
|
/**
|
|
@@ -393,7 +403,7 @@ export class MeterPlus {
|
|
|
393
403
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} CurrentRelativeHumidity: ${this.CurrentRelativeHumidity}`);
|
|
394
404
|
} else {
|
|
395
405
|
this.accessory.context.CurrentRelativeHumidity = this.CurrentRelativeHumidity;
|
|
396
|
-
this.
|
|
406
|
+
this.humidityService?.updateCharacteristic(this.platform.Characteristic.CurrentRelativeHumidity, this.CurrentRelativeHumidity);
|
|
397
407
|
this.debugLog(
|
|
398
408
|
`${this.device.deviceType}: ${this.accessory.displayName}` +
|
|
399
409
|
` updateCharacteristic CurrentRelativeHumidity: ${this.CurrentRelativeHumidity}`,
|
|
@@ -418,7 +428,7 @@ export class MeterPlus {
|
|
|
418
428
|
entry['temp'] = this.CurrentTemperature;
|
|
419
429
|
}
|
|
420
430
|
this.accessory.context.CurrentTemperature = this.CurrentTemperature;
|
|
421
|
-
this.
|
|
431
|
+
this.temperatureService?.updateCharacteristic(this.platform.Characteristic.CurrentTemperature, this.CurrentTemperature);
|
|
422
432
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} updateCharacteristic CurrentTemperature: ${this.CurrentTemperature}`);
|
|
423
433
|
}
|
|
424
434
|
}
|
|
@@ -452,8 +462,14 @@ export class MeterPlus {
|
|
|
452
462
|
mqttmessage.push(`"FirmwareRevision": ${this.FirmwareRevision}`);
|
|
453
463
|
}
|
|
454
464
|
this.accessory.context.FirmwareRevision = this.FirmwareRevision;
|
|
455
|
-
|
|
456
|
-
|
|
465
|
+
|
|
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
|
+
}
|
|
457
473
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
458
474
|
+ `updateCharacteristic FirmwareRevision: ${this.FirmwareRevision}`);
|
|
459
475
|
}
|
|
@@ -630,32 +646,39 @@ export class MeterPlus {
|
|
|
630
646
|
|
|
631
647
|
async apiError(e: any): Promise<void> {
|
|
632
648
|
if (!this.device.meter?.hide_humidity) {
|
|
633
|
-
this.
|
|
649
|
+
this.humidityService?.updateCharacteristic(this.platform.Characteristic.CurrentRelativeHumidity, e);
|
|
634
650
|
}
|
|
635
651
|
if (!this.device.meter?.hide_temperature) {
|
|
636
|
-
this.
|
|
652
|
+
this.temperatureService?.updateCharacteristic(this.platform.Characteristic.CurrentTemperature, e);
|
|
637
653
|
}
|
|
638
654
|
this.batteryService?.updateCharacteristic(this.platform.Characteristic.BatteryLevel, e);
|
|
639
655
|
this.batteryService?.updateCharacteristic(this.platform.Characteristic.StatusLowBattery, e);
|
|
640
656
|
}
|
|
641
657
|
|
|
642
|
-
setFirmwareRevision(accessory: PlatformAccessory<Context>, device: device & devicesConfig)
|
|
643
|
-
this.
|
|
644
|
-
`${this.device.deviceType}: ${this.accessory.displayName}` + ` accessory.context.FirmwareRevision: ${accessory.context.FirmwareRevision}`,
|
|
645
|
-
);
|
|
646
|
-
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
647
|
-
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
658
|
+
async setFirmwareRevision(accessory: PlatformAccessory<Context>, device: device & devicesConfig) {
|
|
659
|
+
await this.refreshStatus();
|
|
648
660
|
if (device.firmware) {
|
|
649
|
-
this.
|
|
661
|
+
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
662
|
+
accessory.context.FirmwareRevision = device.firmware;
|
|
663
|
+
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
664
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} device.firmware, FirmwareRevision: ${this.FirmwareRevision}`);
|
|
650
665
|
} else if (device.version) {
|
|
651
|
-
this.
|
|
652
|
-
|
|
666
|
+
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} device.version: ${device.version}`);
|
|
667
|
+
accessory.context.FirmwareRevision = device.version;
|
|
653
668
|
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
669
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} device.version, FirmwareRevision: ${this.FirmwareRevision}`);
|
|
654
670
|
} else {
|
|
655
|
-
this.
|
|
671
|
+
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
672
|
+
accessory.context.FirmwareRevision = this.platform.version;
|
|
673
|
+
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
674
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} this.platform.version, FirmwareRevision: ${this.FirmwareRevision}`);
|
|
656
675
|
}
|
|
657
|
-
this.
|
|
658
|
-
|
|
676
|
+
this.infoLog(`${this.device.deviceType}: ${this.accessory.displayName} setFirmwareRevision: ${this.FirmwareRevision}`);
|
|
677
|
+
accessory
|
|
678
|
+
.getService(this.platform.Service.AccessoryInformation)!
|
|
679
|
+
.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision)
|
|
680
|
+
.getCharacteristic(this.platform.Characteristic.FirmwareRevision)
|
|
681
|
+
.updateValue(this.FirmwareRevision);
|
|
659
682
|
}
|
|
660
683
|
|
|
661
684
|
async context() {
|
package/src/device/motion.ts
CHANGED
|
@@ -79,10 +79,20 @@ export class Motion {
|
|
|
79
79
|
.getService(this.platform.Service.AccessoryInformation)!
|
|
80
80
|
.setCharacteristic(this.platform.Characteristic.Manufacturer, 'SwitchBot')
|
|
81
81
|
.setCharacteristic(this.platform.Characteristic.Model, 'W1101500')
|
|
82
|
-
.setCharacteristic(this.platform.Characteristic.SerialNumber, device.deviceId!)
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
.
|
|
82
|
+
.setCharacteristic(this.platform.Characteristic.SerialNumber, device.deviceId!);
|
|
83
|
+
|
|
84
|
+
if (accessory.context.FirmwareRevision) {
|
|
85
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName}`
|
|
86
|
+
+ ` accessory.context.FirmwareRevision: ${accessory.context.FirmwareRevision}`);
|
|
87
|
+
accessory
|
|
88
|
+
.getService(this.platform.Service.AccessoryInformation)!
|
|
89
|
+
.setCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision)
|
|
90
|
+
.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision)
|
|
91
|
+
.getCharacteristic(this.platform.Characteristic.FirmwareRevision)
|
|
92
|
+
.updateValue(accessory.context.FirmwareRevision);
|
|
93
|
+
} else {
|
|
94
|
+
this.setFirmwareRevision(accessory, device);
|
|
95
|
+
}
|
|
86
96
|
|
|
87
97
|
// get the Battery service if it exists, otherwise create a new Motion service
|
|
88
98
|
// you can create multiple services for each accessory
|
|
@@ -229,7 +239,7 @@ export class Motion {
|
|
|
229
239
|
+ ` StatusLowBattery: ${this.StatusLowBattery}`);
|
|
230
240
|
|
|
231
241
|
// FirmwareRevision
|
|
232
|
-
this.FirmwareRevision =
|
|
242
|
+
this.FirmwareRevision = this.OpenAPI_FirmwareRevision!;
|
|
233
243
|
}
|
|
234
244
|
|
|
235
245
|
/**
|
|
@@ -402,14 +412,16 @@ export class Motion {
|
|
|
402
412
|
);
|
|
403
413
|
}
|
|
404
414
|
}
|
|
405
|
-
|
|
406
415
|
// FirmwareRevision
|
|
407
416
|
if (this.FirmwareRevision === undefined) {
|
|
408
417
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} FirmwareRevision: ${this.FirmwareRevision}`);
|
|
409
418
|
} else {
|
|
410
419
|
this.accessory.context.FirmwareRevision = this.FirmwareRevision;
|
|
411
|
-
this.
|
|
412
|
-
|
|
420
|
+
this.motionSensorService.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.FirmwareRevision);
|
|
421
|
+
this.batteryService.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.FirmwareRevision);
|
|
422
|
+
if (!this.device.motion?.hide_lightsensor) {
|
|
423
|
+
this.lightSensorService!.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.FirmwareRevision);
|
|
424
|
+
}
|
|
413
425
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
414
426
|
+ `updateCharacteristic FirmwareRevision: ${this.FirmwareRevision}`);
|
|
415
427
|
}
|
|
@@ -561,24 +573,30 @@ export class Motion {
|
|
|
561
573
|
}
|
|
562
574
|
}
|
|
563
575
|
|
|
564
|
-
setFirmwareRevision(accessory: PlatformAccessory<Context>, device: device & devicesConfig)
|
|
565
|
-
|
|
566
|
-
this.debugLog(
|
|
567
|
-
`${this.device.deviceType}: ${this.accessory.displayName}` + ` accessory.context.FirmwareRevision: ${accessory.context.FirmwareRevision}`,
|
|
568
|
-
);
|
|
569
|
-
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
570
|
-
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
576
|
+
async setFirmwareRevision(accessory: PlatformAccessory<Context>, device: device & devicesConfig) {
|
|
577
|
+
await this.refreshStatus();
|
|
571
578
|
if (device.firmware) {
|
|
572
|
-
this.
|
|
579
|
+
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
580
|
+
accessory.context.FirmwareRevision = device.firmware;
|
|
581
|
+
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
582
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} device.firmware, FirmwareRevision: ${this.FirmwareRevision}`);
|
|
573
583
|
} else if (device.version) {
|
|
574
|
-
this.
|
|
575
|
-
|
|
584
|
+
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} device.version: ${device.version}`);
|
|
585
|
+
accessory.context.FirmwareRevision = device.version;
|
|
576
586
|
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
587
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} device.version, FirmwareRevision: ${this.FirmwareRevision}`);
|
|
577
588
|
} else {
|
|
578
|
-
this.
|
|
589
|
+
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
590
|
+
accessory.context.FirmwareRevision = this.platform.version;
|
|
591
|
+
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
592
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} this.platform.version, FirmwareRevision: ${this.FirmwareRevision}`);
|
|
579
593
|
}
|
|
580
|
-
this.
|
|
581
|
-
|
|
594
|
+
this.infoLog(`${this.device.deviceType}: ${this.accessory.displayName} setFirmwareRevision: ${this.FirmwareRevision}`);
|
|
595
|
+
accessory
|
|
596
|
+
.getService(this.platform.Service.AccessoryInformation)!
|
|
597
|
+
.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision)
|
|
598
|
+
.getCharacteristic(this.platform.Characteristic.FirmwareRevision)
|
|
599
|
+
.updateValue(this.FirmwareRevision);
|
|
582
600
|
}
|
|
583
601
|
|
|
584
602
|
async context() {
|
package/src/device/plug.ts
CHANGED
|
@@ -60,10 +60,20 @@ export class Plug {
|
|
|
60
60
|
.getService(this.platform.Service.AccessoryInformation)!
|
|
61
61
|
.setCharacteristic(this.platform.Characteristic.Manufacturer, 'SwitchBot')
|
|
62
62
|
.setCharacteristic(this.platform.Characteristic.Model, this.model(device))
|
|
63
|
-
.setCharacteristic(this.platform.Characteristic.SerialNumber, device.deviceId!)
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
.
|
|
63
|
+
.setCharacteristic(this.platform.Characteristic.SerialNumber, device.deviceId!);
|
|
64
|
+
|
|
65
|
+
if (accessory.context.FirmwareRevision) {
|
|
66
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName}`
|
|
67
|
+
+ ` accessory.context.FirmwareRevision: ${accessory.context.FirmwareRevision}`);
|
|
68
|
+
accessory
|
|
69
|
+
.getService(this.platform.Service.AccessoryInformation)!
|
|
70
|
+
.setCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision)
|
|
71
|
+
.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision)
|
|
72
|
+
.getCharacteristic(this.platform.Characteristic.FirmwareRevision)
|
|
73
|
+
.updateValue(accessory.context.FirmwareRevision);
|
|
74
|
+
} else {
|
|
75
|
+
this.setFirmwareRevision(accessory, device);
|
|
76
|
+
}
|
|
67
77
|
|
|
68
78
|
// get the Outlet service if it exists, otherwise create a new Outlet service
|
|
69
79
|
// you can create multiple services for each accessory
|
|
@@ -156,7 +166,7 @@ export class Plug {
|
|
|
156
166
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} On: ${this.On}`);
|
|
157
167
|
|
|
158
168
|
// FirmwareRevision
|
|
159
|
-
this.FirmwareRevision =
|
|
169
|
+
this.FirmwareRevision = this.OpenAPI_FirmwareRevision!;
|
|
160
170
|
}
|
|
161
171
|
|
|
162
172
|
/**
|
|
@@ -430,8 +440,7 @@ export class Plug {
|
|
|
430
440
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} FirmwareRevision: ${this.FirmwareRevision}`);
|
|
431
441
|
} else {
|
|
432
442
|
this.accessory.context.FirmwareRevision = this.FirmwareRevision;
|
|
433
|
-
this.
|
|
434
|
-
.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.FirmwareRevision);
|
|
443
|
+
this.outletService.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.FirmwareRevision);
|
|
435
444
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
436
445
|
+ `updateCharacteristic FirmwareRevision: ${this.FirmwareRevision}`);
|
|
437
446
|
}
|
|
@@ -512,6 +521,7 @@ export class Plug {
|
|
|
512
521
|
let model: string;
|
|
513
522
|
if (device.deviceType === 'Plug Mini (US)') {
|
|
514
523
|
model = 'W1901400';
|
|
524
|
+
model = 'W1901401';
|
|
515
525
|
} else if (device.deviceType === 'Plug Mini (JP)') {
|
|
516
526
|
model = 'W2001400';
|
|
517
527
|
} else {
|
|
@@ -587,24 +597,30 @@ export class Plug {
|
|
|
587
597
|
this.outletService.updateCharacteristic(this.platform.Characteristic.On, e);
|
|
588
598
|
}
|
|
589
599
|
|
|
590
|
-
setFirmwareRevision(accessory: PlatformAccessory<Context>, device: device & devicesConfig)
|
|
591
|
-
|
|
592
|
-
this.debugLog(
|
|
593
|
-
`${this.device.deviceType}: ${this.accessory.displayName}` + ` accessory.context.FirmwareRevision: ${accessory.context.FirmwareRevision}`,
|
|
594
|
-
);
|
|
595
|
-
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
596
|
-
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
600
|
+
async setFirmwareRevision(accessory: PlatformAccessory<Context>, device: device & devicesConfig) {
|
|
601
|
+
await this.refreshStatus();
|
|
597
602
|
if (device.firmware) {
|
|
598
|
-
this.
|
|
603
|
+
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
604
|
+
accessory.context.FirmwareRevision = device.firmware;
|
|
605
|
+
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
606
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} device.firmware, FirmwareRevision: ${this.FirmwareRevision}`);
|
|
599
607
|
} else if (device.version) {
|
|
600
|
-
this.
|
|
601
|
-
|
|
608
|
+
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} device.version: ${device.version}`);
|
|
609
|
+
accessory.context.FirmwareRevision = device.version;
|
|
602
610
|
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
611
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} device.version, FirmwareRevision: ${this.FirmwareRevision}`);
|
|
603
612
|
} else {
|
|
604
|
-
this.
|
|
613
|
+
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
614
|
+
accessory.context.FirmwareRevision = this.platform.version;
|
|
615
|
+
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
616
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} this.platform.version, FirmwareRevision: ${this.FirmwareRevision}`);
|
|
605
617
|
}
|
|
606
|
-
this.
|
|
607
|
-
|
|
618
|
+
this.infoLog(`${this.device.deviceType}: ${this.accessory.displayName} setFirmwareRevision: ${this.FirmwareRevision}`);
|
|
619
|
+
accessory
|
|
620
|
+
.getService(this.platform.Service.AccessoryInformation)!
|
|
621
|
+
.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision)
|
|
622
|
+
.getCharacteristic(this.platform.Characteristic.FirmwareRevision)
|
|
623
|
+
.updateValue(this.FirmwareRevision);
|
|
608
624
|
}
|
|
609
625
|
|
|
610
626
|
async context() {
|
|
@@ -68,10 +68,20 @@ export class RobotVacuumCleaner {
|
|
|
68
68
|
.getService(this.platform.Service.AccessoryInformation)!
|
|
69
69
|
.setCharacteristic(this.platform.Characteristic.Manufacturer, 'SwitchBot')
|
|
70
70
|
.setCharacteristic(this.platform.Characteristic.Model, this.model(device))
|
|
71
|
-
.setCharacteristic(this.platform.Characteristic.SerialNumber, device.deviceId!)
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
.
|
|
71
|
+
.setCharacteristic(this.platform.Characteristic.SerialNumber, device.deviceId!);
|
|
72
|
+
|
|
73
|
+
if (accessory.context.FirmwareRevision) {
|
|
74
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName}`
|
|
75
|
+
+ ` accessory.context.FirmwareRevision: ${accessory.context.FirmwareRevision}`);
|
|
76
|
+
accessory
|
|
77
|
+
.getService(this.platform.Service.AccessoryInformation)!
|
|
78
|
+
.setCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision)
|
|
79
|
+
.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision)
|
|
80
|
+
.getCharacteristic(this.platform.Characteristic.FirmwareRevision)
|
|
81
|
+
.updateValue(accessory.context.FirmwareRevision);
|
|
82
|
+
} else {
|
|
83
|
+
this.setFirmwareRevision(accessory, device);
|
|
84
|
+
}
|
|
75
85
|
|
|
76
86
|
// get the Lightbulb service if it exists, otherwise create a new Lightbulb service
|
|
77
87
|
// you can create multiple services for each accessory
|
|
@@ -202,7 +212,7 @@ export class RobotVacuumCleaner {
|
|
|
202
212
|
this.debugLog(`${this.accessory.displayName} BatteryLevel: ${this.BatteryLevel}, StatusLowBattery: ${this.StatusLowBattery}`);
|
|
203
213
|
|
|
204
214
|
// FirmwareRevision
|
|
205
|
-
this.FirmwareRevision =
|
|
215
|
+
this.FirmwareRevision = this.OpenAPI_FirmwareRevision!;
|
|
206
216
|
}
|
|
207
217
|
|
|
208
218
|
/**
|
|
@@ -594,8 +604,8 @@ export class RobotVacuumCleaner {
|
|
|
594
604
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} FirmwareRevision: ${this.FirmwareRevision}`);
|
|
595
605
|
} else {
|
|
596
606
|
this.accessory.context.FirmwareRevision = this.FirmwareRevision;
|
|
597
|
-
this.
|
|
598
|
-
|
|
607
|
+
this.batteryService.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.FirmwareRevision);
|
|
608
|
+
this.robotVacuumCleanerService.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.FirmwareRevision);
|
|
599
609
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
600
610
|
+ `updateCharacteristic FirmwareRevision: ${this.FirmwareRevision}`);
|
|
601
611
|
}
|
|
@@ -751,21 +761,30 @@ export class RobotVacuumCleaner {
|
|
|
751
761
|
this.robotVacuumCleanerService.updateCharacteristic(this.platform.Characteristic.On, e);
|
|
752
762
|
}
|
|
753
763
|
|
|
754
|
-
setFirmwareRevision(accessory: PlatformAccessory<Context>, device: device & devicesConfig)
|
|
755
|
-
this.
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
760
|
-
if (accessory.context.FirmwareRevision) {
|
|
764
|
+
async setFirmwareRevision(accessory: PlatformAccessory<Context>, device: device & devicesConfig) {
|
|
765
|
+
await this.refreshStatus();
|
|
766
|
+
if (device.firmware) {
|
|
767
|
+
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
768
|
+
accessory.context.FirmwareRevision = device.firmware;
|
|
761
769
|
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
762
|
-
|
|
763
|
-
|
|
770
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} device.firmware, FirmwareRevision: ${this.FirmwareRevision}`);
|
|
771
|
+
} else if (device.version) {
|
|
772
|
+
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} device.version: ${device.version}`);
|
|
773
|
+
accessory.context.FirmwareRevision = device.version;
|
|
774
|
+
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
775
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} device.version, FirmwareRevision: ${this.FirmwareRevision}`);
|
|
764
776
|
} else {
|
|
765
|
-
this.
|
|
777
|
+
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
778
|
+
accessory.context.FirmwareRevision = this.platform.version;
|
|
779
|
+
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
780
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} this.platform.version, FirmwareRevision: ${this.FirmwareRevision}`);
|
|
766
781
|
}
|
|
767
|
-
this.
|
|
768
|
-
|
|
782
|
+
this.infoLog(`${this.device.deviceType}: ${this.accessory.displayName} setFirmwareRevision: ${this.FirmwareRevision}`);
|
|
783
|
+
accessory
|
|
784
|
+
.getService(this.platform.Service.AccessoryInformation)!
|
|
785
|
+
.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision)
|
|
786
|
+
.getCharacteristic(this.platform.Characteristic.FirmwareRevision)
|
|
787
|
+
.updateValue(this.FirmwareRevision);
|
|
769
788
|
}
|
|
770
789
|
|
|
771
790
|
async context() {
|
|
@@ -62,10 +62,20 @@ export class AirConditioner {
|
|
|
62
62
|
.getService(this.platform.Service.AccessoryInformation)!
|
|
63
63
|
.setCharacteristic(this.platform.Characteristic.Manufacturer, 'SwitchBot')
|
|
64
64
|
.setCharacteristic(this.platform.Characteristic.Model, device.remoteType)
|
|
65
|
-
.setCharacteristic(this.platform.Characteristic.SerialNumber, device.deviceId!)
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
.
|
|
65
|
+
.setCharacteristic(this.platform.Characteristic.SerialNumber, device.deviceId!);
|
|
66
|
+
|
|
67
|
+
if (accessory.context.FirmwareRevision) {
|
|
68
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName}`
|
|
69
|
+
+ ` accessory.context.FirmwareRevision: ${accessory.context.FirmwareRevision}`);
|
|
70
|
+
accessory
|
|
71
|
+
.getService(this.platform.Service.AccessoryInformation)!
|
|
72
|
+
.setCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision)
|
|
73
|
+
.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision)
|
|
74
|
+
.getCharacteristic(this.platform.Characteristic.FirmwareRevision)
|
|
75
|
+
.updateValue(accessory.context.FirmwareRevision);
|
|
76
|
+
} else {
|
|
77
|
+
this.setFirmwareRevision(accessory, device);
|
|
78
|
+
}
|
|
69
79
|
|
|
70
80
|
// get the Television service if it exists, otherwise create a new Television service
|
|
71
81
|
// you can create multiple services for each accessory
|
|
@@ -631,21 +641,24 @@ export class AirConditioner {
|
|
|
631
641
|
this.coolerService.updateCharacteristic(this.platform.Characteristic.CoolingThresholdTemperature, e);
|
|
632
642
|
}
|
|
633
643
|
|
|
634
|
-
setFirmwareRevision(accessory: PlatformAccessory, device: irdevice & irDevicesConfig)
|
|
635
|
-
|
|
636
|
-
`${this.device.remoteType}: ${this.accessory.displayName}
|
|
637
|
-
|
|
638
|
-
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
639
|
-
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
640
|
-
if (accessory.context.FirmwareRevision) {
|
|
644
|
+
async setFirmwareRevision(accessory: PlatformAccessory, device: irdevice & irDevicesConfig) {
|
|
645
|
+
if (device.firmware) {
|
|
646
|
+
this.warnLog(`${this.device.remoteType}: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
647
|
+
accessory.context.FirmwareRevision = device.firmware;
|
|
641
648
|
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
642
|
-
|
|
643
|
-
this.FirmwareRevision = device.firmware;
|
|
649
|
+
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} device.firmware, FirmwareRevision: ${this.FirmwareRevision}`);
|
|
644
650
|
} else {
|
|
645
|
-
this.
|
|
651
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
652
|
+
accessory.context.FirmwareRevision = this.platform.version;
|
|
653
|
+
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
654
|
+
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} this.platform.version, FirmwareRevision: ${this.FirmwareRevision}`);
|
|
646
655
|
}
|
|
647
|
-
this.
|
|
648
|
-
|
|
656
|
+
this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} setFirmwareRevision: ${this.FirmwareRevision}`);
|
|
657
|
+
accessory
|
|
658
|
+
.getService(this.platform.Service.AccessoryInformation)!
|
|
659
|
+
.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision)
|
|
660
|
+
.getCharacteristic(this.platform.Characteristic.FirmwareRevision)
|
|
661
|
+
.updateValue(this.FirmwareRevision);
|
|
649
662
|
}
|
|
650
663
|
|
|
651
664
|
async context(): Promise<void> {
|
|
@@ -56,10 +56,20 @@ export class AirPurifier {
|
|
|
56
56
|
.getService(this.platform.Service.AccessoryInformation)!
|
|
57
57
|
.setCharacteristic(this.platform.Characteristic.Manufacturer, 'SwitchBot')
|
|
58
58
|
.setCharacteristic(this.platform.Characteristic.Model, device.remoteType)
|
|
59
|
-
.setCharacteristic(this.platform.Characteristic.SerialNumber, device.deviceId!)
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
.
|
|
59
|
+
.setCharacteristic(this.platform.Characteristic.SerialNumber, device.deviceId!);
|
|
60
|
+
|
|
61
|
+
if (accessory.context.FirmwareRevision) {
|
|
62
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName}`
|
|
63
|
+
+ ` accessory.context.FirmwareRevision: ${accessory.context.FirmwareRevision}`);
|
|
64
|
+
accessory
|
|
65
|
+
.getService(this.platform.Service.AccessoryInformation)!
|
|
66
|
+
.setCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision)
|
|
67
|
+
.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision)
|
|
68
|
+
.getCharacteristic(this.platform.Characteristic.FirmwareRevision)
|
|
69
|
+
.updateValue(accessory.context.FirmwareRevision);
|
|
70
|
+
} else {
|
|
71
|
+
this.setFirmwareRevision(accessory, device);
|
|
72
|
+
}
|
|
63
73
|
|
|
64
74
|
// get the Television service if it exists, otherwise create a new Television service
|
|
65
75
|
// you can create multiple services for each accessory
|
|
@@ -378,21 +388,26 @@ export class AirPurifier {
|
|
|
378
388
|
this.airPurifierService.updateCharacteristic(this.platform.Characteristic.Active, e);
|
|
379
389
|
}
|
|
380
390
|
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
)
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
if (accessory.context.FirmwareRevision) {
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
async setFirmwareRevision(accessory: PlatformAccessory, device: irdevice & irDevicesConfig) {
|
|
394
|
+
if (device.firmware) {
|
|
395
|
+
this.warnLog(`${this.device.remoteType}: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
396
|
+
accessory.context.FirmwareRevision = device.firmware;
|
|
388
397
|
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
389
|
-
|
|
390
|
-
this.FirmwareRevision = device.firmware;
|
|
398
|
+
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} device.firmware, FirmwareRevision: ${this.FirmwareRevision}`);
|
|
391
399
|
} else {
|
|
392
|
-
this.
|
|
400
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
401
|
+
accessory.context.FirmwareRevision = this.platform.version;
|
|
402
|
+
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
403
|
+
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} this.platform.version, FirmwareRevision: ${this.FirmwareRevision}`);
|
|
393
404
|
}
|
|
394
|
-
this.
|
|
395
|
-
|
|
405
|
+
this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} setFirmwareRevision: ${this.FirmwareRevision}`);
|
|
406
|
+
accessory
|
|
407
|
+
.getService(this.platform.Service.AccessoryInformation)!
|
|
408
|
+
.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision)
|
|
409
|
+
.getCharacteristic(this.platform.Characteristic.FirmwareRevision)
|
|
410
|
+
.updateValue(this.FirmwareRevision);
|
|
396
411
|
}
|
|
397
412
|
|
|
398
413
|
private context() {
|