@switchbot/homebridge-switchbot 3.5.1-beta.18 → 3.5.1-beta.19

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.
Files changed (71) hide show
  1. package/dist/device/blindtilt.js +8 -8
  2. package/dist/device/blindtilt.js.map +1 -1
  3. package/dist/device/bot.js +2 -2
  4. package/dist/device/bot.js.map +1 -1
  5. package/dist/device/ceilinglight.js +2 -2
  6. package/dist/device/ceilinglight.js.map +1 -1
  7. package/dist/device/colorbulb.js +2 -2
  8. package/dist/device/colorbulb.js.map +1 -1
  9. package/dist/device/contact.js +2 -2
  10. package/dist/device/contact.js.map +1 -1
  11. package/dist/device/curtain.js +2 -2
  12. package/dist/device/curtain.js.map +1 -1
  13. package/dist/device/device.d.ts.map +1 -1
  14. package/dist/device/device.js +4 -26
  15. package/dist/device/device.js.map +1 -1
  16. package/dist/device/fan.js +6 -6
  17. package/dist/device/fan.js.map +1 -1
  18. package/dist/device/hub.js +2 -2
  19. package/dist/device/hub.js.map +1 -1
  20. package/dist/device/humidifier.js +2 -2
  21. package/dist/device/humidifier.js.map +1 -1
  22. package/dist/device/iosensor.js +2 -2
  23. package/dist/device/iosensor.js.map +1 -1
  24. package/dist/device/lightstrip.js +2 -2
  25. package/dist/device/lightstrip.js.map +1 -1
  26. package/dist/device/lock.js +2 -2
  27. package/dist/device/lock.js.map +1 -1
  28. package/dist/device/meter.js +2 -2
  29. package/dist/device/meter.js.map +1 -1
  30. package/dist/device/meterplus.js +2 -2
  31. package/dist/device/meterplus.js.map +1 -1
  32. package/dist/device/motion.js +2 -2
  33. package/dist/device/motion.js.map +1 -1
  34. package/dist/device/plug.js +2 -2
  35. package/dist/device/plug.js.map +1 -1
  36. package/dist/device/robotvacuumcleaner.js +2 -2
  37. package/dist/device/robotvacuumcleaner.js.map +1 -1
  38. package/dist/device/waterdetector.js +2 -2
  39. package/dist/device/waterdetector.js.map +1 -1
  40. package/dist/homebridge-ui/public/index.html +2 -2
  41. package/dist/irdevice/airconditioner.js +2 -2
  42. package/dist/irdevice/irdevice.d.ts.map +1 -1
  43. package/dist/irdevice/irdevice.js +3 -31
  44. package/dist/irdevice/irdevice.js.map +1 -1
  45. package/dist/platform.d.ts.map +1 -1
  46. package/dist/platform.js +396 -498
  47. package/dist/platform.js.map +1 -1
  48. package/package.json +1 -1
  49. package/src/device/blindtilt.ts +8 -8
  50. package/src/device/bot.ts +2 -2
  51. package/src/device/ceilinglight.ts +2 -2
  52. package/src/device/colorbulb.ts +2 -2
  53. package/src/device/contact.ts +2 -2
  54. package/src/device/curtain.ts +2 -2
  55. package/src/device/device.ts +4 -22
  56. package/src/device/fan.ts +6 -6
  57. package/src/device/hub.ts +2 -2
  58. package/src/device/humidifier.ts +2 -2
  59. package/src/device/iosensor.ts +2 -2
  60. package/src/device/lightstrip.ts +2 -2
  61. package/src/device/lock.ts +2 -2
  62. package/src/device/meter.ts +2 -2
  63. package/src/device/meterplus.ts +2 -2
  64. package/src/device/motion.ts +2 -2
  65. package/src/device/plug.ts +2 -2
  66. package/src/device/robotvacuumcleaner.ts +2 -2
  67. package/src/device/waterdetector.ts +2 -2
  68. package/src/homebridge-ui/public/index.html +2 -2
  69. package/src/irdevice/airconditioner.ts +2 -2
  70. package/src/irdevice/irdevice.ts +3 -26
  71. package/src/platform.ts +397 -528
package/src/device/bot.ts CHANGED
@@ -613,8 +613,8 @@ export class Bot extends deviceBase {
613
613
  .setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
614
614
  .getCharacteristic(this.hap.Characteristic.FirmwareRevision)
615
615
  .updateValue(deviceVersion);
616
- this.accessory.context.deviceVersion = deviceVersion;
617
- await this.debugLog(`deviceVersion: ${this.accessory.context.deviceVersion}`);
616
+ this.accessory.context.version = deviceVersion;
617
+ await this.debugLog(`version: ${this.accessory.context.version}`);
618
618
  }
619
619
  }
620
620
 
@@ -246,8 +246,8 @@ export class CeilingLight extends deviceBase {
246
246
  .setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
247
247
  .getCharacteristic(this.hap.Characteristic.FirmwareRevision)
248
248
  .updateValue(deviceVersion);
249
- this.accessory.context.deviceVersion = deviceVersion;
250
- await this.debugSuccessLog(`deviceVersion: ${this.accessory.context.deviceVersion}`);
249
+ this.accessory.context.version = deviceVersion;
250
+ await this.debugSuccessLog(`version: ${this.accessory.context.version}`);
251
251
  }
252
252
  }
253
253
 
@@ -257,8 +257,8 @@ export class ColorBulb extends deviceBase {
257
257
  .setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
258
258
  .getCharacteristic(this.hap.Characteristic.FirmwareRevision)
259
259
  .updateValue(deviceVersion);
260
- this.accessory.context.deviceVersion = deviceVersion;
261
- await this.debugSuccessLog(`deviceVersion: ${this.accessory.context.deviceVersion}`);
260
+ this.accessory.context.version = deviceVersion;
261
+ await this.debugSuccessLog(`version: ${this.accessory.context.version}`);
262
262
  }
263
263
  }
264
264
 
@@ -254,8 +254,8 @@ export class Contact extends deviceBase {
254
254
  .setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
255
255
  .getCharacteristic(this.hap.Characteristic.FirmwareRevision)
256
256
  .updateValue(deviceVersion);
257
- this.accessory.context.deviceVersion = deviceVersion;
258
- await this.debugLog(`deviceVersion: ${this.accessory.context.deviceVersion}`);
257
+ this.accessory.context.version = deviceVersion;
258
+ await this.debugLog(`version: ${this.accessory.context.version}`);
259
259
  }
260
260
  }
261
261
 
@@ -396,8 +396,8 @@ export class Curtain extends deviceBase {
396
396
  .setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
397
397
  .getCharacteristic(this.hap.Characteristic.FirmwareRevision)
398
398
  .updateValue(deviceVersion);
399
- this.accessory.context.deviceVersion = deviceVersion;
400
- await this.debugSuccessLog(`deviceVersion: ${this.accessory.context.deviceVersion}`);
399
+ this.accessory.context.version = deviceVersion;
400
+ await this.debugSuccessLog(`version: ${this.accessory.context.version}`);
401
401
  }
402
402
  }
403
403
 
@@ -659,32 +659,14 @@ export abstract class deviceBase {
659
659
  device.bleModelName = SwitchBotBLEModelName.Unknown;
660
660
  device.bleModelFriednlyName = SwitchBotBLEModelFriendlyName.Unknown;
661
661
  }
662
- this.debugLog(`Model: ${device.model}, BLE Model: ${device.bleModel}, BLE Model Name: ${device.bleModelName}, `
662
+ await this.debugLog(`Model: ${device.model}, BLE Model: ${device.bleModel}, BLE Model Name: ${device.bleModelName}, `
663
663
  + `BLE Model Friendly Name: ${device.bleModelFriednlyName}`);
664
664
  accessory.context.model = device.model;
665
665
  accessory.context.bleModel = device.bleModel;
666
666
  accessory.context.bleModelName = device.bleModelName;
667
667
  accessory.context.bleModelFriednlyName = device.bleModelFriednlyName;
668
668
 
669
- // Firmware Version
670
- let deviceFirmwareVersion: string;
671
- if (device.firmware) {
672
- deviceFirmwareVersion = device.firmware;
673
- this.debugSuccessLog(`1 FirmwareRevision: ${device.firmware}`);
674
- } else if (device.version) {
675
- deviceFirmwareVersion = JSON.stringify(device.version);
676
- this.debugSuccessLog(`2 FirmwareRevision: ${device.version}`);
677
- } else if (accessory.context.deviceVersion) {
678
- deviceFirmwareVersion = accessory.context.deviceVersion;
679
- this.debugSuccessLog(`3 FirmwareRevision: ${accessory.context.deviceVersion}`);
680
- } else {
681
- deviceFirmwareVersion = this.platform.version ?? '0.0.0';
682
- if (this.platform.version) {
683
- this.debugSuccessLog(`4 FirmwareRevision: ${this.platform.version}`);
684
- } else {
685
- this.debugSuccessLog(`5 FirmwareRevision: ${deviceFirmwareVersion}`);
686
- }
687
- }
669
+ const deviceFirmwareVersion = device.firmware ?? device.version ?? accessory.context.version ?? this.platform.version ?? '0.0.0';
688
670
  const version = deviceFirmwareVersion.toString();
689
671
  this.debugLog(`Firmware Version: ${version.replace(/^V|-.*$/g, '')}`);
690
672
  let deviceVersion: string;
@@ -703,8 +685,8 @@ export abstract class deviceBase {
703
685
  .setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
704
686
  .getCharacteristic(this.hap.Characteristic.FirmwareRevision)
705
687
  .updateValue(deviceVersion);
706
- accessory.context.deviceVersion = deviceVersion;
707
- this.debugSuccessLog(`deviceVersion: ${accessory.context.deviceVersion}`);
688
+ accessory.context.version = deviceVersion;
689
+ this.debugSuccessLog(`version: ${accessory.context.version}`);
708
690
  }
709
691
 
710
692
  async statusCode(statusCode: number): Promise<void> {
package/src/device/fan.ts CHANGED
@@ -215,7 +215,7 @@ export class Fan extends deviceBase {
215
215
  await this.debugLog('openAPIparseStatus');
216
216
  await this.debugLog(`(version, battery, powerState, oscillation, chargingStatus, fanSpeed) = OpenAPI:(${this.deviceStatus.version},`
217
217
  + ` ${this.deviceStatus.battery}, ${this.deviceStatus.power}, ${this.deviceStatus.oscillation}, ${this.deviceStatus.chargingStatus},`
218
- + ` ${this.deviceStatus.fanSpeed}), current:(${this.accessory.context.deviceVersion}, ${this.Battery.BatteryLevel}, ${this.Fan.Active},`
218
+ + ` ${this.deviceStatus.fanSpeed}), current:(${this.accessory.context.version}, ${this.Battery.BatteryLevel}, ${this.Fan.Active},`
219
219
  + ` ${this.Fan.SwingMode}, ${this.Battery.ChargingState}, ${this.Fan.RotationSpeed})`);
220
220
 
221
221
  // Active
@@ -255,8 +255,8 @@ export class Fan extends deviceBase {
255
255
  .setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
256
256
  .getCharacteristic(this.hap.Characteristic.FirmwareRevision)
257
257
  .updateValue(deviceVersion);
258
- this.accessory.context.deviceVersion = deviceVersion;
259
- await this.debugSuccessLog(`deviceVersion: ${this.accessory.context.deviceVersion}`);
258
+ this.accessory.context.version = deviceVersion;
259
+ await this.debugSuccessLog(`version: ${this.accessory.context.version}`);
260
260
  }
261
261
  }
262
262
 
@@ -264,7 +264,7 @@ export class Fan extends deviceBase {
264
264
  await this.debugLog('parseStatusWebhook');
265
265
  await this.debugLog(`(version, battery, powerState, oscillation, chargingStatus, fanSpeed) = Webhook:(${this.webhookContext.version},`
266
266
  + ` ${this.webhookContext.battery}, ${this.webhookContext.powerState}, ${this.webhookContext.oscillation},`
267
- + ` ${this.webhookContext.chargingStatus}, ${this.webhookContext.fanSpeed}), current:(${this.accessory.context.deviceVersion},`
267
+ + ` ${this.webhookContext.chargingStatus}, ${this.webhookContext.fanSpeed}), current:(${this.accessory.context.version},`
268
268
  + ` ${this.Battery.BatteryLevel}, ${this.Fan.Active}, ${this.Fan.SwingMode}, ${this.Battery.ChargingState}, ${this.Fan.RotationSpeed})`);
269
269
 
270
270
  // Active
@@ -303,8 +303,8 @@ export class Fan extends deviceBase {
303
303
  .setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
304
304
  .getCharacteristic(this.hap.Characteristic.FirmwareRevision)
305
305
  .updateValue(deviceVersion);
306
- this.accessory.context.deviceVersion = deviceVersion;
307
- await this.debugSuccessLog(`deviceVersion: ${this.accessory.context.deviceVersion}`);
306
+ this.accessory.context.version = deviceVersion;
307
+ await this.debugSuccessLog(`version: ${this.accessory.context.version}`);
308
308
  }
309
309
  }
310
310
 
package/src/device/hub.ts CHANGED
@@ -233,8 +233,8 @@ export class Hub extends deviceBase {
233
233
  .setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
234
234
  .getCharacteristic(this.hap.Characteristic.FirmwareRevision)
235
235
  .updateValue(deviceVersion);
236
- this.accessory.context.deviceVersion = deviceVersion;
237
- await this.debugSuccessLog(`deviceVersion: ${this.accessory.context.deviceVersion}`);
236
+ this.accessory.context.version = deviceVersion;
237
+ await this.debugSuccessLog(`version: ${this.accessory.context.version}`);
238
238
  }
239
239
  }
240
240
 
@@ -289,8 +289,8 @@ export class Humidifier extends deviceBase {
289
289
  .setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
290
290
  .getCharacteristic(this.hap.Characteristic.FirmwareRevision)
291
291
  .updateValue(deviceVersion);
292
- this.accessory.context.deviceVersion = deviceVersion;
293
- await this.debugSuccessLog(`deviceVersion: ${this.accessory.context.deviceVersion}`);
292
+ this.accessory.context.version = deviceVersion;
293
+ await this.debugSuccessLog(`version: ${this.accessory.context.version}`);
294
294
  }
295
295
  }
296
296
 
@@ -237,8 +237,8 @@ export class IOSensor extends deviceBase {
237
237
  .setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
238
238
  .getCharacteristic(this.hap.Characteristic.FirmwareRevision)
239
239
  .updateValue(deviceVersion);
240
- this.accessory.context.deviceVersion = deviceVersion;
241
- await this.debugSuccessLog(`deviceVersion: ${this.accessory.context.deviceVersion}`);
240
+ this.accessory.context.version = deviceVersion;
241
+ await this.debugSuccessLog(`version: ${this.accessory.context.version}`);
242
242
  }
243
243
  }
244
244
 
@@ -260,8 +260,8 @@ export class StripLight extends deviceBase {
260
260
  .setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
261
261
  .getCharacteristic(this.hap.Characteristic.FirmwareRevision)
262
262
  .updateValue(deviceVersion);
263
- this.accessory.context.deviceVersion = deviceVersion;
264
- await this.debugSuccessLog(`deviceVersion: ${this.accessory.context.deviceVersion}`);
263
+ this.accessory.context.version = deviceVersion;
264
+ await this.debugSuccessLog(`version: ${this.accessory.context.version}`);
265
265
  }
266
266
  }
267
267
 
@@ -271,8 +271,8 @@ export class Lock extends deviceBase {
271
271
  .setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
272
272
  .getCharacteristic(this.hap.Characteristic.FirmwareRevision)
273
273
  .updateValue(deviceVersion);
274
- this.accessory.context.deviceVersion = deviceVersion;
275
- await this.debugSuccessLog(`deviceVersion: ${this.accessory.context.deviceVersion}`);
274
+ this.accessory.context.version = deviceVersion;
275
+ await this.debugSuccessLog(`version: ${this.accessory.context.version}`);
276
276
  }
277
277
  }
278
278
 
@@ -229,8 +229,8 @@ export class Meter extends deviceBase {
229
229
  .setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
230
230
  .getCharacteristic(this.hap.Characteristic.FirmwareRevision)
231
231
  .updateValue(deviceVersion);
232
- this.accessory.context.deviceVersion = deviceVersion;
233
- await this.debugSuccessLog(`deviceVersion: ${this.accessory.context.deviceVersion}`);
232
+ this.accessory.context.version = deviceVersion;
233
+ await this.debugSuccessLog(`version: ${this.accessory.context.version}`);
234
234
  }
235
235
  }
236
236
 
@@ -230,8 +230,8 @@ export class MeterPlus extends deviceBase {
230
230
  .setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
231
231
  .getCharacteristic(this.hap.Characteristic.FirmwareRevision)
232
232
  .updateValue(deviceVersion);
233
- this.accessory.context.deviceVersion = deviceVersion;
234
- this.debugSuccessLog(`deviceVersion: ${this.accessory.context.deviceVersion}`);
233
+ this.accessory.context.version = deviceVersion;
234
+ this.debugSuccessLog(`v: ${this.accessory.context.version}`);
235
235
  }
236
236
  }
237
237
 
@@ -217,8 +217,8 @@ export class Motion extends deviceBase {
217
217
  .setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
218
218
  .getCharacteristic(this.hap.Characteristic.FirmwareRevision)
219
219
  .updateValue(deviceVersion);
220
- this.accessory.context.deviceVersion = deviceVersion;
221
- await this.debugLog(`deviceVersion: ${this.accessory.context.deviceVersion}`);
220
+ this.accessory.context.version = deviceVersion;
221
+ await this.debugLog(`version: ${this.accessory.context.version}`);
222
222
  }
223
223
  }
224
224
 
@@ -128,8 +128,8 @@ export class Plug extends deviceBase {
128
128
  .setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
129
129
  .getCharacteristic(this.hap.Characteristic.FirmwareRevision)
130
130
  .updateValue(deviceVersion);
131
- this.accessory.context.deviceVersion = deviceVersion;
132
- await this.debugSuccessLog(`deviceVersion: ${this.accessory.context.deviceVersion}`);
131
+ this.accessory.context.version = deviceVersion;
132
+ await this.debugSuccessLog(`version: ${this.accessory.context.version}`);
133
133
  }
134
134
  }
135
135
 
@@ -214,8 +214,8 @@ export class RobotVacuumCleaner extends deviceBase {
214
214
  .setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
215
215
  .getCharacteristic(this.hap.Characteristic.FirmwareRevision)
216
216
  .updateValue(deviceVersion);
217
- this.accessory.context.deviceVersion = deviceVersion;
218
- await this.debugSuccessLog(`deviceVersion: ${this.accessory.context.deviceVersion}`);
217
+ this.accessory.context.version = deviceVersion;
218
+ await this.debugSuccessLog(`version: ${this.accessory.context.version}`);
219
219
  }
220
220
  }
221
221
 
@@ -196,8 +196,8 @@ export class WaterDetector extends deviceBase {
196
196
  .setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
197
197
  .getCharacteristic(this.hap.Characteristic.FirmwareRevision)
198
198
  .updateValue(deviceVersion);
199
- this.accessory.context.deviceVersion = deviceVersion;
200
- await this.debugSuccessLog(`deviceVersion: ${this.accessory.context.deviceVersion}`);
199
+ this.accessory.context.version = deviceVersion;
200
+ await this.debugSuccessLog(`version: ${this.accessory.context.version}`);
201
201
  }
202
202
  }
203
203
 
@@ -51,7 +51,7 @@
51
51
  <tbody>
52
52
  <tr>
53
53
  <th scope="row">Device ID</th>
54
- <td id="deviceID"></td>
54
+ <td id="deviceId"></td>
55
55
  </tr>
56
56
  <tr>
57
57
  <th scope="row">Model</th>
@@ -166,7 +166,7 @@
166
166
  const thisAcc = cachedAccessories.find((x) => x.UUID === UUID);
167
167
  const context = thisAcc.context;
168
168
  document.getElementById('displayName').innerHTML = thisAcc.displayName;
169
- document.getElementById('deviceID').innerHTML = context.deviceID;
169
+ document.getElementById('deviceId').innerHTML = context.deviceId;
170
170
  document.getElementById('model').innerHTML = context.model;
171
171
  document.getElementById('version').innerHTML = context.version;
172
172
  document.getElementById('deviceType').innerHTML = context.deviceType;
@@ -375,7 +375,7 @@ export class AirConditioner extends irdeviceBase {
375
375
  if (this.meter?.context?.CurrentTemperature) {
376
376
  this.accessory.context.CurrentTemperature = this.meter.context.CurrentTemperature;
377
377
  await this.debugLog(''
378
- + `Using CurrentTemperature from ${this.meter.context.deviceType} (${this.meter.context.deviceID})`);
378
+ + `Using CurrentTemperature from ${this.meter.context.deviceType} (${this.meter.context.deviceId})`);
379
379
  }
380
380
 
381
381
  this.HeaterCooler.CurrentTemperature = this.accessory.context.CurrentTemperature || 24;
@@ -387,7 +387,7 @@ export class AirConditioner extends irdeviceBase {
387
387
  if (this.meter?.context?.CurrentRelativeHumidity) {
388
388
  this.accessory.context.CurrentRelativeHumidity = this.meter.context.CurrentRelativeHumidity;
389
389
  await this.debugLog(''
390
- + `Using CurrentRelativeHumidity from ${this.meter.context.deviceType} (${this.meter.context.deviceID})`);
390
+ + `Using CurrentRelativeHumidity from ${this.meter.context.deviceType} (${this.meter.context.deviceId})`);
391
391
  }
392
392
 
393
393
  this.HumiditySensor!.CurrentRelativeHumidity = this.accessory.context.CurrentRelativeHumidity || 0;
@@ -146,31 +146,8 @@ export abstract class irdeviceBase {
146
146
  accessory.context.model = device.remoteType;
147
147
  accessory.context.deviceId = device.deviceId;
148
148
  accessory.context.remoteType = device.remoteType;
149
- if (device.firmware) {
150
- accessory.context.firmware = device.firmware;
151
- } else if (device.firmware === undefined || accessory.context.firmware === undefined) {
152
- device.firmware = this.platform.version;
153
- accessory.context.firmware = device.firmware;
154
- } else {
155
- accessory.context.firmware = 'Unknown';
156
- }
157
149
 
158
- // Firmware Version
159
- let deviceFirmwareVersion: string;
160
- if (device.firmware) {
161
- deviceFirmwareVersion = device.firmware;
162
- this.debugSuccessLog(`${device.remoteType}: ${accessory.displayName} 1 FirmwareRevision: ${device.firmware}`);
163
- } else if (accessory.context.deviceVersion) {
164
- deviceFirmwareVersion = accessory.context.deviceVersion;
165
- this.debugSuccessLog(`${device.remoteType}: ${accessory.displayName} 2 FirmwareRevision: ${accessory.context.deviceVersion}`);
166
- } else {
167
- deviceFirmwareVersion = this.platform.version ?? '0.0.0';
168
- if (this.platform.version) {
169
- this.debugSuccessLog(`${device.remoteType}: ${accessory.displayName} 3 FirmwareRevision: ${this.platform.version}`);
170
- } else {
171
- this.debugSuccessLog(`${device.remoteType}: ${accessory.displayName} 4 FirmwareRevision: ${deviceFirmwareVersion}`);
172
- }
173
- }
150
+ const deviceFirmwareVersion = device.firmware ?? accessory.context.version ?? this.platform.version ?? '0.0.0';
174
151
  const version = deviceFirmwareVersion.toString();
175
152
  await this.debugLog(`${this.device.remoteType}: ${accessory.displayName} Firmware Version: ${version?.replace(/^V|-.*$/g, '')}`);
176
153
  let deviceVersion: string;
@@ -189,8 +166,8 @@ export abstract class irdeviceBase {
189
166
  .setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
190
167
  .getCharacteristic(this.hap.Characteristic.FirmwareRevision)
191
168
  .updateValue(deviceVersion);
192
- accessory.context.deviceVersion = deviceVersion;
193
- this.debugSuccessLog(`${device.remoteType}: ${accessory.displayName} deviceVersion: ${accessory.context.deviceVersion}`);
169
+ accessory.context.version = deviceVersion;
170
+ this.debugSuccessLog(`version: ${accessory.context.version}`);
194
171
  }
195
172
 
196
173
  async pushChangeRequest(bodyChange: string): Promise<{ body: any; statusCode: any; }> {