@switchbot/homebridge-switchbot 3.5.0-beta.64 → 3.5.0-beta.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/device/blindtilt.d.ts.map +1 -1
- package/dist/device/blindtilt.js +17 -7
- package/dist/device/blindtilt.js.map +1 -1
- package/dist/device/bot.d.ts.map +1 -1
- package/dist/device/bot.js +6 -3
- package/dist/device/bot.js.map +1 -1
- package/dist/device/ceilinglight.d.ts.map +1 -1
- package/dist/device/ceilinglight.js +6 -3
- package/dist/device/ceilinglight.js.map +1 -1
- package/dist/device/colorbulb.d.ts.map +1 -1
- package/dist/device/colorbulb.js +6 -4
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/device/contact.d.ts.map +1 -1
- package/dist/device/contact.js +6 -3
- package/dist/device/contact.js.map +1 -1
- package/dist/device/curtain.d.ts.map +1 -1
- package/dist/device/curtain.js +6 -3
- package/dist/device/curtain.js.map +1 -1
- package/dist/device/device.d.ts.map +1 -1
- package/dist/device/device.js +38 -19
- package/dist/device/device.js.map +1 -1
- package/dist/device/fan.d.ts.map +1 -1
- package/dist/device/fan.js +6 -3
- package/dist/device/fan.js.map +1 -1
- package/dist/device/hub.d.ts.map +1 -1
- package/dist/device/hub.js +6 -3
- package/dist/device/hub.js.map +1 -1
- package/dist/device/humidifier.d.ts.map +1 -1
- package/dist/device/humidifier.js +6 -3
- package/dist/device/humidifier.js.map +1 -1
- package/dist/device/iosensor.d.ts.map +1 -1
- package/dist/device/iosensor.js +6 -3
- package/dist/device/iosensor.js.map +1 -1
- package/dist/device/lightstrip.d.ts.map +1 -1
- package/dist/device/lightstrip.js +6 -3
- package/dist/device/lightstrip.js.map +1 -1
- package/dist/device/lock.d.ts.map +1 -1
- package/dist/device/lock.js +6 -3
- package/dist/device/lock.js.map +1 -1
- package/dist/device/meter.d.ts.map +1 -1
- package/dist/device/meter.js +6 -3
- package/dist/device/meter.js.map +1 -1
- package/dist/device/meterplus.d.ts.map +1 -1
- package/dist/device/meterplus.js +6 -3
- package/dist/device/meterplus.js.map +1 -1
- package/dist/device/motion.d.ts.map +1 -1
- package/dist/device/motion.js +6 -3
- package/dist/device/motion.js.map +1 -1
- package/dist/device/plug.d.ts.map +1 -1
- package/dist/device/plug.js +6 -3
- package/dist/device/plug.js.map +1 -1
- package/dist/device/robotvacuumcleaner.d.ts.map +1 -1
- package/dist/device/robotvacuumcleaner.js +6 -3
- package/dist/device/robotvacuumcleaner.js.map +1 -1
- package/dist/device/waterdetector.d.ts.map +1 -1
- package/dist/device/waterdetector.js +6 -3
- package/dist/device/waterdetector.js.map +1 -1
- package/package.json +1 -1
- package/src/device/blindtilt.ts +16 -7
- package/src/device/bot.ts +6 -3
- package/src/device/ceilinglight.ts +6 -3
- package/src/device/colorbulb.ts +6 -4
- package/src/device/contact.ts +6 -3
- package/src/device/curtain.ts +8 -7
- package/src/device/device.ts +40 -21
- package/src/device/fan.ts +6 -3
- package/src/device/hub.ts +6 -3
- package/src/device/humidifier.ts +6 -3
- package/src/device/iosensor.ts +7 -3
- package/src/device/lightstrip.ts +6 -3
- package/src/device/lock.ts +6 -3
- package/src/device/meter.ts +6 -3
- package/src/device/meterplus.ts +7 -3
- package/src/device/motion.ts +6 -3
- package/src/device/plug.ts +6 -3
- package/src/device/robotvacuumcleaner.ts +6 -3
- package/src/device/waterdetector.ts +6 -3
package/src/device/blindtilt.ts
CHANGED
|
@@ -460,14 +460,23 @@ export class BlindTilt extends deviceBase {
|
|
|
460
460
|
// Firmware Version
|
|
461
461
|
const version = deviceStatus.body.version?.toString();
|
|
462
462
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Firmware Version: ${version?.replace(/^V|-.*$/g, '')}`);
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
463
|
+
let deviceVersion: string;
|
|
464
|
+
if (version?.includes('.') === false) {
|
|
465
|
+
const replace = version?.replace(/^V|-.*$/g, '');
|
|
466
|
+
const match = replace?.match(/.{1,1}/g);
|
|
467
|
+
const blindTiltVersion = match?.join('.') ?? '0.0.0';
|
|
468
|
+
deviceVersion = blindTiltVersion;
|
|
469
|
+
} else {
|
|
470
|
+
deviceVersion = version?.replace(/^V|-.*$/g, '') ?? '0.0.0';
|
|
470
471
|
}
|
|
472
|
+
this.accessory
|
|
473
|
+
.getService(this.hap.Service.AccessoryInformation)!
|
|
474
|
+
.setCharacteristic(this.hap.Characteristic.HardwareRevision, deviceVersion)
|
|
475
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
|
|
476
|
+
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
477
|
+
.updateValue(deviceVersion);
|
|
478
|
+
this.accessory.context.deviceVersion = deviceVersion;
|
|
479
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceVersion: ${this.accessory.context.deviceVersion}`);
|
|
471
480
|
}
|
|
472
481
|
|
|
473
482
|
async refreshStatus(): Promise<void> {
|
package/src/device/bot.ts
CHANGED
|
@@ -592,12 +592,15 @@ export class Bot extends deviceBase {
|
|
|
592
592
|
const version = deviceStatus.body.version?.toString();
|
|
593
593
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Firmware Version: ${version?.replace(/^V|-.*$/g, '')}`);
|
|
594
594
|
if (deviceStatus.body.version) {
|
|
595
|
-
|
|
595
|
+
const deviceVersion = version?.replace(/^V|-.*$/g, '') ?? '0.0.0';
|
|
596
596
|
this.accessory
|
|
597
597
|
.getService(this.hap.Service.AccessoryInformation)!
|
|
598
|
-
.setCharacteristic(this.hap.Characteristic.
|
|
598
|
+
.setCharacteristic(this.hap.Characteristic.HardwareRevision, deviceVersion)
|
|
599
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
|
|
599
600
|
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
600
|
-
.updateValue(
|
|
601
|
+
.updateValue(deviceVersion);
|
|
602
|
+
this.accessory.context.deviceVersion = deviceVersion;
|
|
603
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceVersion: ${this.accessory.context.deviceVersion}`);
|
|
601
604
|
}
|
|
602
605
|
}
|
|
603
606
|
|
|
@@ -295,12 +295,15 @@ export class CeilingLight extends deviceBase {
|
|
|
295
295
|
const version = deviceStatus.body.version?.toString();
|
|
296
296
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Firmware Version: ${version?.replace(/^V|-.*$/g, '')}`);
|
|
297
297
|
if (deviceStatus.body.version) {
|
|
298
|
-
|
|
298
|
+
const deviceVersion = version?.replace(/^V|-.*$/g, '') ?? '0.0.0';
|
|
299
299
|
this.accessory
|
|
300
300
|
.getService(this.hap.Service.AccessoryInformation)!
|
|
301
|
-
.setCharacteristic(this.hap.Characteristic.
|
|
301
|
+
.setCharacteristic(this.hap.Characteristic.HardwareRevision, deviceVersion)
|
|
302
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
|
|
302
303
|
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
303
|
-
.updateValue(
|
|
304
|
+
.updateValue(deviceVersion);
|
|
305
|
+
this.accessory.context.deviceVersion = deviceVersion;
|
|
306
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceVersion: ${this.accessory.context.deviceVersion}`);
|
|
304
307
|
}
|
|
305
308
|
}
|
|
306
309
|
|
package/src/device/colorbulb.ts
CHANGED
|
@@ -63,7 +63,6 @@ export class ColorBulb extends deviceBase {
|
|
|
63
63
|
ColorTemperature: accessory.context.ColorTemperature ?? 140,
|
|
64
64
|
};
|
|
65
65
|
accessory.context.LightBulb = this.LightBulb as object;
|
|
66
|
-
this.errorLog(`${device.deviceType}: ${accessory.displayName} LightBulb Context: ${JSON.stringify(accessory.context.LightBulb)}`);
|
|
67
66
|
|
|
68
67
|
// Adaptive Lighting
|
|
69
68
|
if (this.adaptiveLightingShift === -1 && accessory.context.adaptiveLighting) {
|
|
@@ -350,12 +349,15 @@ export class ColorBulb extends deviceBase {
|
|
|
350
349
|
const version = deviceStatus.body.version?.toString();
|
|
351
350
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Firmware Version: ${version?.replace(/^V|-.*$/g, '')}`);
|
|
352
351
|
if (deviceStatus.body.version) {
|
|
353
|
-
|
|
352
|
+
const deviceVersion = version?.replace(/^V|-.*$/g, '') ?? '0.0.0';
|
|
354
353
|
this.accessory
|
|
355
354
|
.getService(this.hap.Service.AccessoryInformation)!
|
|
356
|
-
.setCharacteristic(this.hap.Characteristic.
|
|
355
|
+
.setCharacteristic(this.hap.Characteristic.HardwareRevision, deviceVersion)
|
|
356
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
|
|
357
357
|
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
358
|
-
.updateValue(
|
|
358
|
+
.updateValue(deviceVersion);
|
|
359
|
+
this.accessory.context.deviceVersion = deviceVersion;
|
|
360
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceVersion: ${this.accessory.context.deviceVersion}`);
|
|
359
361
|
}
|
|
360
362
|
}
|
|
361
363
|
|
package/src/device/contact.ts
CHANGED
|
@@ -309,12 +309,15 @@ export class Contact extends deviceBase {
|
|
|
309
309
|
const version = deviceStatus.body.version?.toString();
|
|
310
310
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Firmware Version: ${version?.replace(/^V|-.*$/g, '')}`);
|
|
311
311
|
if (deviceStatus.body.version) {
|
|
312
|
-
|
|
312
|
+
const deviceVersion = version?.replace(/^V|-.*$/g, '') ?? '0.0.0';
|
|
313
313
|
this.accessory
|
|
314
314
|
.getService(this.hap.Service.AccessoryInformation)!
|
|
315
|
-
.setCharacteristic(this.hap.Characteristic.
|
|
315
|
+
.setCharacteristic(this.hap.Characteristic.HardwareRevision, deviceVersion)
|
|
316
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
|
|
316
317
|
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
317
|
-
.updateValue(
|
|
318
|
+
.updateValue(deviceVersion);
|
|
319
|
+
this.accessory.context.deviceVersion = deviceVersion;
|
|
320
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceVersion: ${this.accessory.context.deviceVersion}`);
|
|
318
321
|
}
|
|
319
322
|
}
|
|
320
323
|
|
package/src/device/curtain.ts
CHANGED
|
@@ -422,10 +422,8 @@ export class Curtain extends deviceBase {
|
|
|
422
422
|
} else {
|
|
423
423
|
this.Battery.StatusLowBattery = this.hap.Characteristic.StatusLowBattery.BATTERY_LEVEL_NORMAL;
|
|
424
424
|
}
|
|
425
|
-
this.debugLog(
|
|
426
|
-
|
|
427
|
-
+ ` StatusLowBattery: ${this.Battery.StatusLowBattery}`,
|
|
428
|
-
);
|
|
425
|
+
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} BatteryLevel: ${this.Battery.BatteryLevel},`
|
|
426
|
+
+ ` StatusLowBattery: ${this.Battery.StatusLowBattery}`);
|
|
429
427
|
}
|
|
430
428
|
|
|
431
429
|
async openAPIparseStatus(deviceStatus: deviceStatus): Promise<void> {
|
|
@@ -505,12 +503,15 @@ export class Curtain extends deviceBase {
|
|
|
505
503
|
const version = deviceStatus.body.version?.toString();
|
|
506
504
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Firmware Version: ${version?.replace(/^V|-.*$/g, '')}`);
|
|
507
505
|
if (deviceStatus.body.version) {
|
|
508
|
-
|
|
506
|
+
const deviceVersion = version?.replace(/^V|-.*$/g, '') ?? '0.0.0';
|
|
509
507
|
this.accessory
|
|
510
508
|
.getService(this.hap.Service.AccessoryInformation)!
|
|
511
|
-
.setCharacteristic(this.hap.Characteristic.
|
|
509
|
+
.setCharacteristic(this.hap.Characteristic.HardwareRevision, deviceVersion)
|
|
510
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
|
|
512
511
|
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
513
|
-
.updateValue(
|
|
512
|
+
.updateValue(deviceVersion);
|
|
513
|
+
this.accessory.context.deviceVersion = deviceVersion;
|
|
514
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceVersion: ${this.accessory.context.deviceVersion}`);
|
|
514
515
|
}
|
|
515
516
|
}
|
|
516
517
|
|
package/src/device/device.ts
CHANGED
|
@@ -68,10 +68,10 @@ export abstract class deviceBase {
|
|
|
68
68
|
accessory
|
|
69
69
|
.getService(this.hap.Service.AccessoryInformation)!
|
|
70
70
|
.setCharacteristic(this.hap.Characteristic.Manufacturer, 'SwitchBot')
|
|
71
|
-
.setCharacteristic(this.hap.Characteristic.Name,
|
|
72
|
-
.setCharacteristic(this.hap.Characteristic.ConfiguredName,
|
|
73
|
-
.setCharacteristic(this.hap.Characteristic.Model,
|
|
74
|
-
.setCharacteristic(this.hap.Characteristic.SerialNumber,
|
|
71
|
+
.setCharacteristic(this.hap.Characteristic.Name, device.deviceName)
|
|
72
|
+
.setCharacteristic(this.hap.Characteristic.ConfiguredName, device.deviceName)
|
|
73
|
+
.setCharacteristic(this.hap.Characteristic.Model, device.model!)
|
|
74
|
+
.setCharacteristic(this.hap.Characteristic.SerialNumber, device.deviceId);
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
async getDeviceLogSettings(device: device & devicesConfig): Promise<void> {
|
|
@@ -539,29 +539,48 @@ export abstract class deviceBase {
|
|
|
539
539
|
device.bleModel = SwitchBotBLEModel.Unknown;
|
|
540
540
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Model: ${device.model}, BLE Model: ${device.bleModel}`);
|
|
541
541
|
}
|
|
542
|
-
accessory.context.name = device.deviceName;
|
|
543
542
|
accessory.context.model = device.model;
|
|
544
|
-
accessory.context.deviceId = device.deviceId;
|
|
545
|
-
accessory.context.deviceType = device.deviceType;
|
|
546
543
|
|
|
544
|
+
let deviceFirmwareVersion: string;
|
|
547
545
|
if (device.firmware) {
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
}
|
|
557
|
-
|
|
546
|
+
deviceFirmwareVersion = device.firmware;
|
|
547
|
+
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} 1 FirmwareRevision: ${device.firmware}`);
|
|
548
|
+
} else if (device.version) {
|
|
549
|
+
deviceFirmwareVersion = device.version;
|
|
550
|
+
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} 2 FirmwareRevision: ${device.version}`);
|
|
551
|
+
} else if (accessory.context.deviceVersion) {
|
|
552
|
+
deviceFirmwareVersion = accessory.context.deviceVersion;
|
|
553
|
+
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} 3 FirmwareRevision: ${accessory.context.deviceVersion}`);
|
|
554
|
+
} else {
|
|
555
|
+
deviceFirmwareVersion = this.platform.version ?? '0.0.0';
|
|
556
|
+
if (this.platform.version) {
|
|
557
|
+
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} 4 FirmwareRevision: ${this.platform.version}`);
|
|
558
|
+
} else {
|
|
559
|
+
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} 5 FirmwareRevision: ${deviceFirmwareVersion}`);
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
// Firmware Version
|
|
565
|
+
const version = deviceFirmwareVersion.toString();
|
|
566
|
+
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Firmware Version: ${version?.replace(/^V|-.*$/g, '')}`);
|
|
567
|
+
let deviceVersion: string;
|
|
568
|
+
if (version?.includes('.') === false) {
|
|
569
|
+
const replace = version?.replace(/^V|-.*$/g, '');
|
|
570
|
+
const match = replace?.match(/.{1,1}/g);
|
|
571
|
+
const blindTiltVersion = match?.join('.') ?? '0.0.0';
|
|
572
|
+
deviceVersion = blindTiltVersion;
|
|
573
|
+
} else {
|
|
574
|
+
deviceVersion = version?.replace(/^V|-.*$/g, '') ?? '0.0.0';
|
|
575
|
+
}
|
|
558
576
|
this.accessory
|
|
559
577
|
.getService(this.hap.Service.AccessoryInformation)!
|
|
560
|
-
.setCharacteristic(this.hap.Characteristic.HardwareRevision,
|
|
561
|
-
.setCharacteristic(this.hap.Characteristic.FirmwareRevision,
|
|
578
|
+
.setCharacteristic(this.hap.Characteristic.HardwareRevision, deviceVersion)
|
|
579
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
|
|
562
580
|
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
563
|
-
.updateValue(
|
|
564
|
-
this.
|
|
581
|
+
.updateValue(deviceVersion);
|
|
582
|
+
this.accessory.context.deviceVersion = deviceVersion;
|
|
583
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceVersion: ${this.accessory.context.deviceVersion}`);
|
|
565
584
|
}
|
|
566
585
|
|
|
567
586
|
async statusCode(statusCode: number): Promise<void> {
|
package/src/device/fan.ts
CHANGED
|
@@ -245,12 +245,15 @@ export class Fan extends deviceBase {
|
|
|
245
245
|
const version = deviceStatus.body.version?.toString();
|
|
246
246
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Firmware Version: ${version?.replace(/^V|-.*$/g, '')}`);
|
|
247
247
|
if (deviceStatus.body.version) {
|
|
248
|
-
|
|
248
|
+
const deviceVersion = version?.replace(/^V|-.*$/g, '') ?? '0.0.0';
|
|
249
249
|
this.accessory
|
|
250
250
|
.getService(this.hap.Service.AccessoryInformation)!
|
|
251
|
-
.setCharacteristic(this.hap.Characteristic.
|
|
251
|
+
.setCharacteristic(this.hap.Characteristic.HardwareRevision, deviceVersion)
|
|
252
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
|
|
252
253
|
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
253
|
-
.updateValue(
|
|
254
|
+
.updateValue(deviceVersion);
|
|
255
|
+
this.accessory.context.deviceVersion = deviceVersion;
|
|
256
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceVersion: ${this.accessory.context.deviceVersion}`);
|
|
254
257
|
}
|
|
255
258
|
}
|
|
256
259
|
|
package/src/device/hub.ts
CHANGED
|
@@ -216,12 +216,15 @@ export class Hub extends deviceBase {
|
|
|
216
216
|
const version = deviceStatus.body.version?.toString();
|
|
217
217
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Firmware Version: ${version?.replace(/^V|-.*$/g, '')}`);
|
|
218
218
|
if (deviceStatus.body.version) {
|
|
219
|
-
|
|
219
|
+
const deviceVersion = version?.replace(/^V|-.*$/g, '') ?? '0.0.0';
|
|
220
220
|
this.accessory
|
|
221
221
|
.getService(this.hap.Service.AccessoryInformation)!
|
|
222
|
-
.setCharacteristic(this.hap.Characteristic.
|
|
222
|
+
.setCharacteristic(this.hap.Characteristic.HardwareRevision, deviceVersion)
|
|
223
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
|
|
223
224
|
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
224
|
-
.updateValue(
|
|
225
|
+
.updateValue(deviceVersion);
|
|
226
|
+
this.accessory.context.deviceVersion = deviceVersion;
|
|
227
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceVersion: ${this.accessory.context.deviceVersion}`);
|
|
225
228
|
}
|
|
226
229
|
}
|
|
227
230
|
|
package/src/device/humidifier.ts
CHANGED
|
@@ -271,12 +271,15 @@ export class Humidifier extends deviceBase {
|
|
|
271
271
|
const version = deviceStatus.body.version?.toString();
|
|
272
272
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Firmware Version: ${version?.replace(/^V|-.*$/g, '')}`);
|
|
273
273
|
if (deviceStatus.body.version) {
|
|
274
|
-
|
|
274
|
+
const deviceVersion = version?.replace(/^V|-.*$/g, '') ?? '0.0.0';
|
|
275
275
|
this.accessory
|
|
276
276
|
.getService(this.hap.Service.AccessoryInformation)!
|
|
277
|
-
.setCharacteristic(this.hap.Characteristic.
|
|
277
|
+
.setCharacteristic(this.hap.Characteristic.HardwareRevision, deviceVersion)
|
|
278
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
|
|
278
279
|
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
279
|
-
.updateValue(
|
|
280
|
+
.updateValue(deviceVersion);
|
|
281
|
+
this.accessory.context.deviceVersion = deviceVersion;
|
|
282
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceVersion: ${this.accessory.context.deviceVersion}`);
|
|
280
283
|
}
|
|
281
284
|
}
|
|
282
285
|
|
package/src/device/iosensor.ts
CHANGED
|
@@ -232,16 +232,20 @@ export class IOSensor extends deviceBase {
|
|
|
232
232
|
this.TemperatureSensor!.CurrentTemperature = deviceStatus.body.temperature!;
|
|
233
233
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Temperature: ${this.TemperatureSensor!.CurrentTemperature}°c`);
|
|
234
234
|
}
|
|
235
|
+
|
|
235
236
|
// Firmware Version
|
|
236
237
|
const version = deviceStatus.body.version?.toString();
|
|
237
238
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Firmware Version: ${version?.replace(/^V|-.*$/g, '')}`);
|
|
238
239
|
if (deviceStatus.body.version) {
|
|
239
|
-
|
|
240
|
+
const deviceVersion = version?.replace(/^V|-.*$/g, '') ?? '0.0.0';
|
|
240
241
|
this.accessory
|
|
241
242
|
.getService(this.hap.Service.AccessoryInformation)!
|
|
242
|
-
.setCharacteristic(this.hap.Characteristic.
|
|
243
|
+
.setCharacteristic(this.hap.Characteristic.HardwareRevision, deviceVersion)
|
|
244
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
|
|
243
245
|
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
244
|
-
.updateValue(
|
|
246
|
+
.updateValue(deviceVersion);
|
|
247
|
+
this.accessory.context.deviceVersion = deviceVersion;
|
|
248
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceVersion: ${this.accessory.context.deviceVersion}`);
|
|
245
249
|
}
|
|
246
250
|
}
|
|
247
251
|
|
package/src/device/lightstrip.ts
CHANGED
|
@@ -334,12 +334,15 @@ export class StripLight extends deviceBase {
|
|
|
334
334
|
const version = deviceStatus.body.version?.toString();
|
|
335
335
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Firmware Version: ${version?.replace(/^V|-.*$/g, '')}`);
|
|
336
336
|
if (deviceStatus.body.version) {
|
|
337
|
-
|
|
337
|
+
const deviceVersion = version?.replace(/^V|-.*$/g, '') ?? '0.0.0';
|
|
338
338
|
this.accessory
|
|
339
339
|
.getService(this.hap.Service.AccessoryInformation)!
|
|
340
|
-
.setCharacteristic(this.hap.Characteristic.
|
|
340
|
+
.setCharacteristic(this.hap.Characteristic.HardwareRevision, deviceVersion)
|
|
341
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
|
|
341
342
|
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
342
|
-
.updateValue(
|
|
343
|
+
.updateValue(deviceVersion);
|
|
344
|
+
this.accessory.context.deviceVersion = deviceVersion;
|
|
345
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceVersion: ${this.accessory.context.deviceVersion}`);
|
|
343
346
|
}
|
|
344
347
|
}
|
|
345
348
|
|
package/src/device/lock.ts
CHANGED
|
@@ -274,12 +274,15 @@ export class Lock extends deviceBase {
|
|
|
274
274
|
const version = deviceStatus.body.version?.toString();
|
|
275
275
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Firmware Version: ${version?.replace(/^V|-.*$/g, '')}`);
|
|
276
276
|
if (deviceStatus.body.version) {
|
|
277
|
-
|
|
277
|
+
const deviceVersion = version?.replace(/^V|-.*$/g, '') ?? '0.0.0';
|
|
278
278
|
this.accessory
|
|
279
279
|
.getService(this.hap.Service.AccessoryInformation)!
|
|
280
|
-
.setCharacteristic(this.hap.Characteristic.
|
|
280
|
+
.setCharacteristic(this.hap.Characteristic.HardwareRevision, deviceVersion)
|
|
281
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
|
|
281
282
|
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
282
|
-
.updateValue(
|
|
283
|
+
.updateValue(deviceVersion);
|
|
284
|
+
this.accessory.context.deviceVersion = deviceVersion;
|
|
285
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceVersion: ${this.accessory.context.deviceVersion}`);
|
|
283
286
|
}
|
|
284
287
|
}
|
|
285
288
|
|
package/src/device/meter.ts
CHANGED
|
@@ -230,12 +230,15 @@ export class Meter extends deviceBase {
|
|
|
230
230
|
const version = deviceStatus.body.version?.toString();
|
|
231
231
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Firmware Version: ${version?.replace(/^V|-.*$/g, '')}`);
|
|
232
232
|
if (deviceStatus.body.version) {
|
|
233
|
-
|
|
233
|
+
const deviceVersion = version?.replace(/^V|-.*$/g, '') ?? '0.0.0';
|
|
234
234
|
this.accessory
|
|
235
235
|
.getService(this.hap.Service.AccessoryInformation)!
|
|
236
|
-
.setCharacteristic(this.hap.Characteristic.
|
|
236
|
+
.setCharacteristic(this.hap.Characteristic.HardwareRevision, deviceVersion)
|
|
237
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
|
|
237
238
|
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
238
|
-
.updateValue(
|
|
239
|
+
.updateValue(deviceVersion);
|
|
240
|
+
this.accessory.context.deviceVersion = deviceVersion;
|
|
241
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceVersion: ${this.accessory.context.deviceVersion}`);
|
|
239
242
|
}
|
|
240
243
|
}
|
|
241
244
|
|
package/src/device/meterplus.ts
CHANGED
|
@@ -227,16 +227,20 @@ export class MeterPlus extends deviceBase {
|
|
|
227
227
|
this.TemperatureSensor!.CurrentTemperature = deviceStatus.body.temperature!;
|
|
228
228
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Temperature: ${this.TemperatureSensor!.CurrentTemperature}°c`);
|
|
229
229
|
}
|
|
230
|
+
|
|
230
231
|
// Firmware Version
|
|
231
232
|
const version = deviceStatus.body.version?.toString();
|
|
232
233
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Firmware Version: ${version?.replace(/^V|-.*$/g, '')}`);
|
|
233
234
|
if (deviceStatus.body.version) {
|
|
234
|
-
|
|
235
|
+
const deviceVersion = version?.replace(/^V|-.*$/g, '') ?? '0.0.0';
|
|
235
236
|
this.accessory
|
|
236
237
|
.getService(this.hap.Service.AccessoryInformation)!
|
|
237
|
-
.setCharacteristic(this.hap.Characteristic.
|
|
238
|
+
.setCharacteristic(this.hap.Characteristic.HardwareRevision, deviceVersion)
|
|
239
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
|
|
238
240
|
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
239
|
-
.updateValue(
|
|
241
|
+
.updateValue(deviceVersion);
|
|
242
|
+
this.accessory.context.deviceVersion = deviceVersion;
|
|
243
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceVersion: ${this.accessory.context.deviceVersion}`);
|
|
240
244
|
}
|
|
241
245
|
}
|
|
242
246
|
|
package/src/device/motion.ts
CHANGED
|
@@ -238,12 +238,15 @@ export class Motion extends deviceBase {
|
|
|
238
238
|
const version = deviceStatus.body.version?.toString();
|
|
239
239
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Firmware Version: ${version?.replace(/^V|-.*$/g, '')}`);
|
|
240
240
|
if (deviceStatus.body.version) {
|
|
241
|
-
|
|
241
|
+
const deviceVersion = version?.replace(/^V|-.*$/g, '') ?? '0.0.0';
|
|
242
242
|
this.accessory
|
|
243
243
|
.getService(this.hap.Service.AccessoryInformation)!
|
|
244
|
-
.setCharacteristic(this.hap.Characteristic.
|
|
244
|
+
.setCharacteristic(this.hap.Characteristic.HardwareRevision, deviceVersion)
|
|
245
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
|
|
245
246
|
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
246
|
-
.updateValue(
|
|
247
|
+
.updateValue(deviceVersion);
|
|
248
|
+
this.accessory.context.deviceVersion = deviceVersion;
|
|
249
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceVersion: ${this.accessory.context.deviceVersion}`);
|
|
247
250
|
}
|
|
248
251
|
}
|
|
249
252
|
|
package/src/device/plug.ts
CHANGED
|
@@ -135,12 +135,15 @@ export class Plug extends deviceBase {
|
|
|
135
135
|
const version = deviceStatus.body.version?.toString();
|
|
136
136
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Firmware Version: ${version?.replace(/^V|-.*$/g, '')}`);
|
|
137
137
|
if (deviceStatus.body.version) {
|
|
138
|
-
|
|
138
|
+
const deviceVersion = version?.replace(/^V|-.*$/g, '') ?? '0.0.0';
|
|
139
139
|
this.accessory
|
|
140
140
|
.getService(this.hap.Service.AccessoryInformation)!
|
|
141
|
-
.setCharacteristic(this.hap.Characteristic.
|
|
141
|
+
.setCharacteristic(this.hap.Characteristic.HardwareRevision, deviceVersion)
|
|
142
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
|
|
142
143
|
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
143
|
-
.updateValue(
|
|
144
|
+
.updateValue(deviceVersion);
|
|
145
|
+
this.accessory.context.deviceVersion = deviceVersion;
|
|
146
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceVersion: ${this.accessory.context.deviceVersion}`);
|
|
144
147
|
}
|
|
145
148
|
}
|
|
146
149
|
|
|
@@ -229,12 +229,15 @@ export class RobotVacuumCleaner extends deviceBase {
|
|
|
229
229
|
const version = deviceStatus.body.version?.toString();
|
|
230
230
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Firmware Version: ${version?.replace(/^V|-.*$/g, '')}`);
|
|
231
231
|
if (deviceStatus.body.version) {
|
|
232
|
-
|
|
232
|
+
const deviceVersion = version?.replace(/^V|-.*$/g, '') ?? '0.0.0';
|
|
233
233
|
this.accessory
|
|
234
234
|
.getService(this.hap.Service.AccessoryInformation)!
|
|
235
|
-
.setCharacteristic(this.hap.Characteristic.
|
|
235
|
+
.setCharacteristic(this.hap.Characteristic.HardwareRevision, deviceVersion)
|
|
236
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
|
|
236
237
|
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
237
|
-
.updateValue(
|
|
238
|
+
.updateValue(deviceVersion);
|
|
239
|
+
this.accessory.context.deviceVersion = deviceVersion;
|
|
240
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceVersion: ${this.accessory.context.deviceVersion}`);
|
|
238
241
|
}
|
|
239
242
|
}
|
|
240
243
|
|
|
@@ -183,12 +183,15 @@ export class WaterDetector extends deviceBase {
|
|
|
183
183
|
const version = deviceStatus.body.version?.toString();
|
|
184
184
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Firmware Version: ${version?.replace(/^V|-.*$/g, '')}`);
|
|
185
185
|
if (deviceStatus.body.version) {
|
|
186
|
-
|
|
186
|
+
const deviceVersion = version?.replace(/^V|-.*$/g, '') ?? '0.0.0';
|
|
187
187
|
this.accessory
|
|
188
188
|
.getService(this.hap.Service.AccessoryInformation)!
|
|
189
|
-
.setCharacteristic(this.hap.Characteristic.
|
|
189
|
+
.setCharacteristic(this.hap.Characteristic.HardwareRevision, deviceVersion)
|
|
190
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
|
|
190
191
|
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
191
|
-
.updateValue(
|
|
192
|
+
.updateValue(deviceVersion);
|
|
193
|
+
this.accessory.context.deviceVersion = deviceVersion;
|
|
194
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceVersion: ${this.accessory.context.deviceVersion}`);
|
|
192
195
|
}
|
|
193
196
|
}
|
|
194
197
|
|