@switchbot/homebridge-switchbot 1.12.9-beta.10 → 1.12.9-beta.13
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 +1 -1
- package/dist/device/bot.d.ts +3 -0
- package/dist/device/bot.d.ts.map +1 -1
- package/dist/device/bot.js +18 -2
- package/dist/device/bot.js.map +1 -1
- package/dist/device/colorbulb.d.ts +3 -0
- package/dist/device/colorbulb.d.ts.map +1 -1
- package/dist/device/colorbulb.js +18 -2
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/device/contact.d.ts +3 -0
- package/dist/device/contact.d.ts.map +1 -1
- package/dist/device/contact.js +18 -2
- package/dist/device/contact.js.map +1 -1
- package/dist/device/curtain.d.ts +2 -0
- package/dist/device/curtain.d.ts.map +1 -1
- package/dist/device/curtain.js +18 -2
- package/dist/device/curtain.js.map +1 -1
- package/dist/device/humidifier.d.ts +3 -0
- package/dist/device/humidifier.d.ts.map +1 -1
- package/dist/device/humidifier.js +18 -2
- package/dist/device/humidifier.js.map +1 -1
- package/dist/device/lock.d.ts +3 -0
- package/dist/device/lock.d.ts.map +1 -1
- package/dist/device/lock.js +18 -2
- package/dist/device/lock.js.map +1 -1
- package/dist/device/meter.d.ts +3 -0
- package/dist/device/meter.d.ts.map +1 -1
- package/dist/device/meter.js +18 -2
- package/dist/device/meter.js.map +1 -1
- package/dist/device/meterplus.d.ts +3 -0
- package/dist/device/meterplus.d.ts.map +1 -1
- package/dist/device/meterplus.js +18 -2
- package/dist/device/meterplus.js.map +1 -1
- package/dist/device/motion.d.ts +3 -0
- package/dist/device/motion.d.ts.map +1 -1
- package/dist/device/motion.js +18 -2
- package/dist/device/motion.js.map +1 -1
- package/dist/device/plug.d.ts +3 -0
- package/dist/device/plug.d.ts.map +1 -1
- package/dist/device/plug.js +18 -2
- package/dist/device/plug.js.map +1 -1
- package/dist/device/striplight.d.ts +3 -0
- package/dist/device/striplight.d.ts.map +1 -1
- package/dist/device/striplight.js +18 -2
- package/dist/device/striplight.js.map +1 -1
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +42 -41
- package/dist/platform.js.map +1 -1
- package/package.json +1 -1
- package/src/device/bot.ts +18 -2
- package/src/device/colorbulb.ts +18 -2
- package/src/device/contact.ts +18 -2
- package/src/device/curtain.ts +18 -2
- package/src/device/humidifier.ts +18 -2
- package/src/device/lock.ts +18 -2
- package/src/device/meter.ts +18 -2
- package/src/device/meterplus.ts +18 -2
- package/src/device/motion.ts +18 -2
- package/src/device/plug.ts +18 -2
- package/src/device/striplight.ts +18 -2
- package/src/platform.ts +42 -41
package/src/device/meterplus.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { skipWhile } from 'rxjs/operators';
|
|
|
3
3
|
import { SwitchBotPlatform } from '../platform';
|
|
4
4
|
import { Service, PlatformAccessory, Units, CharacteristicValue } from 'homebridge';
|
|
5
5
|
import { DeviceURL, device, devicesConfig, serviceData, ad, switchbot, deviceStatusResponse, temperature, deviceStatus } from '../settings';
|
|
6
|
+
import { Context } from 'vm';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Platform Accessory
|
|
@@ -80,8 +81,8 @@ export class MeterPlus {
|
|
|
80
81
|
.setCharacteristic(this.platform.Characteristic.Manufacturer, 'SwitchBot')
|
|
81
82
|
.setCharacteristic(this.platform.Characteristic.Model, this.model(device))
|
|
82
83
|
.setCharacteristic(this.platform.Characteristic.SerialNumber, device.deviceId!)
|
|
83
|
-
.setCharacteristic(this.platform.Characteristic.FirmwareRevision,
|
|
84
|
-
.getCharacteristic(this.platform.Characteristic.FirmwareRevision).updateValue(accessory
|
|
84
|
+
.setCharacteristic(this.platform.Characteristic.FirmwareRevision, this.FirmwareRevision(accessory, device))
|
|
85
|
+
.getCharacteristic(this.platform.Characteristic.FirmwareRevision).updateValue(this.FirmwareRevision(accessory, device));
|
|
85
86
|
|
|
86
87
|
// Temperature Sensor Service
|
|
87
88
|
if (device.meter?.hide_temperature) {
|
|
@@ -483,6 +484,21 @@ export class MeterPlus {
|
|
|
483
484
|
}
|
|
484
485
|
}
|
|
485
486
|
|
|
487
|
+
FirmwareRevision(accessory: PlatformAccessory<Context>, device: device & devicesConfig): CharacteristicValue {
|
|
488
|
+
let FirmwareRevision: string;
|
|
489
|
+
this.debugLog(`Color Bulb: ${this.accessory.displayName} accessory.context.FirmwareRevision: ${accessory.context.FirmwareRevision}`);
|
|
490
|
+
this.debugLog(`Color Bulb: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
491
|
+
this.debugLog(`Color Bulb: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
492
|
+
if (accessory.context.FirmwareRevision) {
|
|
493
|
+
FirmwareRevision = accessory.context.FirmwareRevision;
|
|
494
|
+
} else if (device.firmware) {
|
|
495
|
+
FirmwareRevision = device.firmware;
|
|
496
|
+
} else {
|
|
497
|
+
FirmwareRevision = this.platform.version;
|
|
498
|
+
}
|
|
499
|
+
return FirmwareRevision;
|
|
500
|
+
}
|
|
501
|
+
|
|
486
502
|
/**
|
|
487
503
|
* Logging for Device
|
|
488
504
|
*/
|
package/src/device/motion.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { skipWhile } from 'rxjs/operators';
|
|
|
3
3
|
import { SwitchBotPlatform } from '../platform';
|
|
4
4
|
import { Service, PlatformAccessory, CharacteristicValue } from 'homebridge';
|
|
5
5
|
import { DeviceURL, device, devicesConfig, serviceData, switchbot, deviceStatusResponse, deviceStatus, ad } from '../settings';
|
|
6
|
+
import { Context } from 'vm';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Platform Accessory
|
|
@@ -68,8 +69,8 @@ export class Motion {
|
|
|
68
69
|
.setCharacteristic(this.platform.Characteristic.Manufacturer, 'SwitchBot')
|
|
69
70
|
.setCharacteristic(this.platform.Characteristic.Model, 'W1101500')
|
|
70
71
|
.setCharacteristic(this.platform.Characteristic.SerialNumber, device.deviceId!)
|
|
71
|
-
.setCharacteristic(this.platform.Characteristic.FirmwareRevision,
|
|
72
|
-
.getCharacteristic(this.platform.Characteristic.FirmwareRevision).updateValue(accessory
|
|
72
|
+
.setCharacteristic(this.platform.Characteristic.FirmwareRevision, this.FirmwareRevision(accessory, device))
|
|
73
|
+
.getCharacteristic(this.platform.Characteristic.FirmwareRevision).updateValue(this.FirmwareRevision(accessory, device));
|
|
73
74
|
|
|
74
75
|
// get the Battery service if it exists, otherwise create a new Motion service
|
|
75
76
|
// you can create multiple services for each accessory
|
|
@@ -455,6 +456,21 @@ export class Motion {
|
|
|
455
456
|
}
|
|
456
457
|
}
|
|
457
458
|
|
|
459
|
+
FirmwareRevision(accessory: PlatformAccessory<Context>, device: device & devicesConfig): CharacteristicValue {
|
|
460
|
+
let FirmwareRevision: string;
|
|
461
|
+
this.debugLog(`Color Bulb: ${this.accessory.displayName} accessory.context.FirmwareRevision: ${accessory.context.FirmwareRevision}`);
|
|
462
|
+
this.debugLog(`Color Bulb: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
463
|
+
this.debugLog(`Color Bulb: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
464
|
+
if (accessory.context.FirmwareRevision) {
|
|
465
|
+
FirmwareRevision = accessory.context.FirmwareRevision;
|
|
466
|
+
} else if (device.firmware) {
|
|
467
|
+
FirmwareRevision = device.firmware;
|
|
468
|
+
} else {
|
|
469
|
+
FirmwareRevision = this.platform.version;
|
|
470
|
+
}
|
|
471
|
+
return FirmwareRevision;
|
|
472
|
+
}
|
|
473
|
+
|
|
458
474
|
minLux(): number {
|
|
459
475
|
if (this.device.motion?.set_minLux) {
|
|
460
476
|
this.set_minLux = this.device.motion!.set_minLux!;
|
package/src/device/plug.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { SwitchBotPlatform } from '../platform';
|
|
|
4
4
|
import { debounceTime, skipWhile, take, tap } from 'rxjs/operators';
|
|
5
5
|
import { Service, PlatformAccessory, CharacteristicValue } from 'homebridge';
|
|
6
6
|
import { DeviceURL, device, devicesConfig, deviceStatusResponse, payload, deviceStatus } from '../settings';
|
|
7
|
+
import { Context } from 'vm';
|
|
7
8
|
|
|
8
9
|
export class Plug {
|
|
9
10
|
// Services
|
|
@@ -51,8 +52,8 @@ export class Plug {
|
|
|
51
52
|
.setCharacteristic(this.platform.Characteristic.Manufacturer, 'SwitchBot')
|
|
52
53
|
.setCharacteristic(this.platform.Characteristic.Model, this.model(device))
|
|
53
54
|
.setCharacteristic(this.platform.Characteristic.SerialNumber, device.deviceId!)
|
|
54
|
-
.setCharacteristic(this.platform.Characteristic.FirmwareRevision,
|
|
55
|
-
.getCharacteristic(this.platform.Characteristic.FirmwareRevision).updateValue(accessory
|
|
55
|
+
.setCharacteristic(this.platform.Characteristic.FirmwareRevision, this.FirmwareRevision(accessory, device))
|
|
56
|
+
.getCharacteristic(this.platform.Characteristic.FirmwareRevision).updateValue(this.FirmwareRevision(accessory, device));
|
|
56
57
|
|
|
57
58
|
// get the Outlet service if it exists, otherwise create a new Outlet service
|
|
58
59
|
// you can create multiple services for each accessory
|
|
@@ -317,6 +318,21 @@ export class Plug {
|
|
|
317
318
|
}
|
|
318
319
|
}
|
|
319
320
|
|
|
321
|
+
FirmwareRevision(accessory: PlatformAccessory<Context>, device: device & devicesConfig): CharacteristicValue {
|
|
322
|
+
let FirmwareRevision: string;
|
|
323
|
+
this.debugLog(`Color Bulb: ${this.accessory.displayName} accessory.context.FirmwareRevision: ${accessory.context.FirmwareRevision}`);
|
|
324
|
+
this.debugLog(`Color Bulb: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
325
|
+
this.debugLog(`Color Bulb: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
326
|
+
if (accessory.context.FirmwareRevision) {
|
|
327
|
+
FirmwareRevision = accessory.context.FirmwareRevision;
|
|
328
|
+
} else if (device.firmware) {
|
|
329
|
+
FirmwareRevision = device.firmware;
|
|
330
|
+
} else {
|
|
331
|
+
FirmwareRevision = this.platform.version;
|
|
332
|
+
}
|
|
333
|
+
return FirmwareRevision;
|
|
334
|
+
}
|
|
335
|
+
|
|
320
336
|
/**
|
|
321
337
|
* Logging for Device
|
|
322
338
|
*/
|
package/src/device/striplight.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { SwitchBotPlatform } from '../platform';
|
|
|
4
4
|
import { debounceTime, skipWhile, tap } from 'rxjs/operators';
|
|
5
5
|
import { Service, PlatformAccessory, CharacteristicValue, ControllerConstructor, Controller, ControllerServiceMap } from 'homebridge';
|
|
6
6
|
import { DeviceURL, device, devicesConfig, switchbot, deviceStatusResponse, payload, hs2rgb, rgb2hs, deviceStatus } from '../settings';
|
|
7
|
+
import { Context } from 'vm';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Platform Accessory
|
|
@@ -79,8 +80,8 @@ export class StripLight {
|
|
|
79
80
|
.setCharacteristic(this.platform.Characteristic.Manufacturer, 'SwitchBot')
|
|
80
81
|
.setCharacteristic(this.platform.Characteristic.Model, 'W1701100')
|
|
81
82
|
.setCharacteristic(this.platform.Characteristic.SerialNumber, device.deviceId!)
|
|
82
|
-
.setCharacteristic(this.platform.Characteristic.FirmwareRevision,
|
|
83
|
-
.getCharacteristic(this.platform.Characteristic.FirmwareRevision).updateValue(accessory
|
|
83
|
+
.setCharacteristic(this.platform.Characteristic.FirmwareRevision, this.FirmwareRevision(accessory, device))
|
|
84
|
+
.getCharacteristic(this.platform.Characteristic.FirmwareRevision).updateValue(this.FirmwareRevision(accessory, device));
|
|
84
85
|
|
|
85
86
|
// get the Lightbulb service if it exists, otherwise create a new Lightbulb service
|
|
86
87
|
// you can create multiple services for each accessory
|
|
@@ -539,6 +540,21 @@ export class StripLight {
|
|
|
539
540
|
}
|
|
540
541
|
}
|
|
541
542
|
|
|
543
|
+
FirmwareRevision(accessory: PlatformAccessory<Context>, device: device & devicesConfig): CharacteristicValue {
|
|
544
|
+
let FirmwareRevision: string;
|
|
545
|
+
this.debugLog(`Color Bulb: ${this.accessory.displayName} accessory.context.FirmwareRevision: ${accessory.context.FirmwareRevision}`);
|
|
546
|
+
this.debugLog(`Color Bulb: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
547
|
+
this.debugLog(`Color Bulb: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
548
|
+
if (accessory.context.FirmwareRevision) {
|
|
549
|
+
FirmwareRevision = accessory.context.FirmwareRevision;
|
|
550
|
+
} else if (device.firmware) {
|
|
551
|
+
FirmwareRevision = device.firmware;
|
|
552
|
+
} else {
|
|
553
|
+
FirmwareRevision = this.platform.version;
|
|
554
|
+
}
|
|
555
|
+
return FirmwareRevision;
|
|
556
|
+
}
|
|
557
|
+
|
|
542
558
|
minStep(device: device & devicesConfig): number {
|
|
543
559
|
if (device.colorbulb?.set_minStep) {
|
|
544
560
|
this.set_minStep = device.colorbulb?.set_minStep;
|
package/src/platform.ts
CHANGED
|
@@ -38,7 +38,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
38
38
|
responseType: 'json',
|
|
39
39
|
});
|
|
40
40
|
|
|
41
|
-
version = require('../package.json').version; // eslint-disable-line @typescript-eslint/no-var-requires
|
|
41
|
+
version = require('../package.json').version || '1.12.8'; // eslint-disable-line @typescript-eslint/no-var-requires
|
|
42
42
|
deviceStatus!: deviceResponses;
|
|
43
43
|
registeringDevice!: boolean;
|
|
44
44
|
debugMode!: boolean;
|
|
@@ -521,10 +521,11 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
521
521
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
522
522
|
|
|
523
523
|
// if you need to update the accessory.context then you should run `api.updatePlatformAccessories`. eg.:
|
|
524
|
+
//existingAccessory.context.firmwareRevision = firmware;
|
|
524
525
|
existingAccessory.context.model = device.deviceType;
|
|
525
526
|
existingAccessory.context.deviceID = device.deviceId;
|
|
526
527
|
existingAccessory.displayName = device.deviceName;
|
|
527
|
-
existingAccessory.context.firmwareRevision = device.firmware
|
|
528
|
+
existingAccessory.context.firmwareRevision = device.firmware;
|
|
528
529
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
529
530
|
await this.connectionTypeExistingAccessory(device, existingAccessory);
|
|
530
531
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -547,7 +548,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
547
548
|
accessory.context.device = device;
|
|
548
549
|
accessory.context.model = device.deviceType;
|
|
549
550
|
accessory.context.deviceID = device.deviceId;
|
|
550
|
-
accessory.context.firmwareRevision = device.firmware
|
|
551
|
+
accessory.context.firmwareRevision = device.firmware;
|
|
551
552
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
552
553
|
await this.connectionTypeNewAccessory(device, accessory);
|
|
553
554
|
// create the accessory handler for the newly create accessory
|
|
@@ -581,7 +582,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
581
582
|
existingAccessory.context.model = device.deviceType;
|
|
582
583
|
existingAccessory.context.deviceID = device.deviceId;
|
|
583
584
|
existingAccessory.displayName = device.deviceName;
|
|
584
|
-
existingAccessory.context.firmwareRevision = device.firmware
|
|
585
|
+
existingAccessory.context.firmwareRevision = device.firmware;
|
|
585
586
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
586
587
|
await this.connectionTypeExistingAccessory(device, existingAccessory);
|
|
587
588
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -606,7 +607,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
606
607
|
accessory.context.device = device;
|
|
607
608
|
accessory.context.model = device.deviceType;
|
|
608
609
|
accessory.context.deviceID = device.deviceId;
|
|
609
|
-
accessory.context.firmwareRevision = device.firmware
|
|
610
|
+
accessory.context.firmwareRevision = device.firmware;
|
|
610
611
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
611
612
|
await this.connectionTypeNewAccessory(device, accessory);
|
|
612
613
|
// accessory.context.firmwareRevision = findaccessories.accessoryAttribute.softwareRevision;
|
|
@@ -639,7 +640,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
639
640
|
existingAccessory.context.model = device.deviceType;
|
|
640
641
|
existingAccessory.context.deviceID = device.deviceId;
|
|
641
642
|
existingAccessory.displayName = device.deviceName;
|
|
642
|
-
existingAccessory.context.firmwareRevision = device.firmware
|
|
643
|
+
existingAccessory.context.firmwareRevision = device.firmware;
|
|
643
644
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
644
645
|
await this.connectionTypeExistingAccessory(device, existingAccessory);
|
|
645
646
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -662,7 +663,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
662
663
|
accessory.context.device = device;
|
|
663
664
|
accessory.context.model = device.deviceType;
|
|
664
665
|
accessory.context.deviceID = device.deviceId;
|
|
665
|
-
accessory.context.firmwareRevision = device.firmware
|
|
666
|
+
accessory.context.firmwareRevision = device.firmware;
|
|
666
667
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
667
668
|
await this.connectionTypeNewAccessory(device, accessory);
|
|
668
669
|
// create the accessory handler for the newly create accessory
|
|
@@ -694,7 +695,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
694
695
|
existingAccessory.context.model = device.deviceType;
|
|
695
696
|
existingAccessory.context.deviceID = device.deviceId;
|
|
696
697
|
existingAccessory.displayName = device.deviceName;
|
|
697
|
-
existingAccessory.context.firmwareRevision = device.firmware
|
|
698
|
+
existingAccessory.context.firmwareRevision = device.firmware;
|
|
698
699
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
699
700
|
await this.connectionTypeExistingAccessory(device, existingAccessory);
|
|
700
701
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -717,7 +718,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
717
718
|
accessory.context.device = device;
|
|
718
719
|
accessory.context.model = device.deviceType;
|
|
719
720
|
accessory.context.deviceID = device.deviceId;
|
|
720
|
-
accessory.context.firmwareRevision = device.firmware
|
|
721
|
+
accessory.context.firmwareRevision = device.firmware;
|
|
721
722
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
722
723
|
await this.connectionTypeNewAccessory(device, accessory);
|
|
723
724
|
// create the accessory handler for the newly create accessory
|
|
@@ -749,7 +750,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
749
750
|
existingAccessory.context.model = device.deviceType;
|
|
750
751
|
existingAccessory.context.deviceID = device.deviceId;
|
|
751
752
|
existingAccessory.displayName = device.deviceName;
|
|
752
|
-
existingAccessory.context.firmwareRevision = device.firmware
|
|
753
|
+
existingAccessory.context.firmwareRevision = device.firmware;
|
|
753
754
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
754
755
|
await this.connectionTypeExistingAccessory(device, existingAccessory);
|
|
755
756
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -772,7 +773,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
772
773
|
accessory.context.device = device;
|
|
773
774
|
accessory.context.model = device.deviceType;
|
|
774
775
|
accessory.context.deviceID = device.deviceId;
|
|
775
|
-
accessory.context.firmwareRevision = device.firmware
|
|
776
|
+
accessory.context.firmwareRevision = device.firmware;
|
|
776
777
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
777
778
|
await this.connectionTypeNewAccessory(device, accessory);
|
|
778
779
|
// create the accessory handler for the newly create accessory
|
|
@@ -804,7 +805,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
804
805
|
existingAccessory.context.model = device.deviceType;
|
|
805
806
|
existingAccessory.context.deviceID = device.deviceId;
|
|
806
807
|
existingAccessory.displayName = device.deviceName;
|
|
807
|
-
existingAccessory.context.firmwareRevision = device.firmware
|
|
808
|
+
existingAccessory.context.firmwareRevision = device.firmware;
|
|
808
809
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
809
810
|
await this.connectionTypeExistingAccessory(device, existingAccessory);
|
|
810
811
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -827,7 +828,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
827
828
|
accessory.context.device = device;
|
|
828
829
|
accessory.context.model = device.deviceType;
|
|
829
830
|
accessory.context.deviceID = device.deviceId;
|
|
830
|
-
accessory.context.firmwareRevision = device.firmware
|
|
831
|
+
accessory.context.firmwareRevision = device.firmware;
|
|
831
832
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
832
833
|
await this.connectionTypeNewAccessory(device, accessory);
|
|
833
834
|
// create the accessory handler for the newly create accessory
|
|
@@ -859,7 +860,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
859
860
|
existingAccessory.context.model = device.deviceType;
|
|
860
861
|
existingAccessory.context.deviceID = device.deviceId;
|
|
861
862
|
existingAccessory.displayName = device.deviceName;
|
|
862
|
-
existingAccessory.context.firmwareRevision = device.firmware
|
|
863
|
+
existingAccessory.context.firmwareRevision = device.firmware;
|
|
863
864
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
864
865
|
await this.connectionTypeExistingAccessory(device, existingAccessory);
|
|
865
866
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -893,7 +894,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
893
894
|
accessory.context.device = device;
|
|
894
895
|
accessory.context.model = device.deviceType;
|
|
895
896
|
accessory.context.deviceID = device.deviceId;
|
|
896
|
-
accessory.context.firmwareRevision = device.firmware
|
|
897
|
+
accessory.context.firmwareRevision = device.firmware;
|
|
897
898
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
898
899
|
await this.connectionTypeNewAccessory(device, accessory);
|
|
899
900
|
// create the accessory handler for the newly create accessory
|
|
@@ -940,7 +941,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
940
941
|
existingAccessory.context.model = device.deviceType;
|
|
941
942
|
existingAccessory.context.deviceID = device.deviceId;
|
|
942
943
|
existingAccessory.displayName = device.deviceName;
|
|
943
|
-
existingAccessory.context.firmwareRevision = device.firmware
|
|
944
|
+
existingAccessory.context.firmwareRevision = device.firmware;
|
|
944
945
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
945
946
|
await this.connectionTypeExistingAccessory(device, existingAccessory);
|
|
946
947
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -963,7 +964,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
963
964
|
accessory.context.device = device;
|
|
964
965
|
accessory.context.model = device.deviceType;
|
|
965
966
|
accessory.context.deviceID = device.deviceId;
|
|
966
|
-
accessory.context.firmwareRevision = device.firmware
|
|
967
|
+
accessory.context.firmwareRevision = device.firmware;
|
|
967
968
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
968
969
|
await this.connectionTypeNewAccessory(device, accessory);
|
|
969
970
|
// create the accessory handler for the newly create accessory
|
|
@@ -995,7 +996,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
995
996
|
existingAccessory.context.model = device.deviceType;
|
|
996
997
|
existingAccessory.context.deviceID = device.deviceId;
|
|
997
998
|
existingAccessory.displayName = device.deviceName;
|
|
998
|
-
existingAccessory.context.firmwareRevision = device.firmware
|
|
999
|
+
existingAccessory.context.firmwareRevision = device.firmware;
|
|
999
1000
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1000
1001
|
await this.connectionTypeExistingAccessory(device, existingAccessory);
|
|
1001
1002
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -1018,7 +1019,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1018
1019
|
accessory.context.device = device;
|
|
1019
1020
|
accessory.context.model = device.deviceType;
|
|
1020
1021
|
accessory.context.deviceID = device.deviceId;
|
|
1021
|
-
accessory.context.firmwareRevision = device.firmware
|
|
1022
|
+
accessory.context.firmwareRevision = device.firmware;
|
|
1022
1023
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1023
1024
|
await this.connectionTypeNewAccessory(device, accessory);
|
|
1024
1025
|
// create the accessory handler for the newly create accessory
|
|
@@ -1050,7 +1051,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1050
1051
|
existingAccessory.context.model = device.deviceType;
|
|
1051
1052
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1052
1053
|
existingAccessory.displayName = device.deviceName;
|
|
1053
|
-
existingAccessory.context.firmwareRevision = device.firmware
|
|
1054
|
+
existingAccessory.context.firmwareRevision = device.firmware;
|
|
1054
1055
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1055
1056
|
await this.connectionTypeExistingAccessory(device, existingAccessory);
|
|
1056
1057
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -1073,7 +1074,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1073
1074
|
accessory.context.device = device;
|
|
1074
1075
|
accessory.context.model = device.deviceType;
|
|
1075
1076
|
accessory.context.deviceID = device.deviceId;
|
|
1076
|
-
accessory.context.firmwareRevision = device.firmware
|
|
1077
|
+
accessory.context.firmwareRevision = device.firmware;
|
|
1077
1078
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1078
1079
|
await this.connectionTypeNewAccessory(device, accessory);
|
|
1079
1080
|
// create the accessory handler for the newly create accessory
|
|
@@ -1105,7 +1106,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1105
1106
|
existingAccessory.context.model = device.deviceType;
|
|
1106
1107
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1107
1108
|
existingAccessory.displayName = device.deviceName;
|
|
1108
|
-
existingAccessory.context.firmwareRevision = device.firmware
|
|
1109
|
+
existingAccessory.context.firmwareRevision = device.firmware;
|
|
1109
1110
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1110
1111
|
await this.connectionTypeExistingAccessory(device, existingAccessory);
|
|
1111
1112
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -1128,7 +1129,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1128
1129
|
accessory.context.device = device;
|
|
1129
1130
|
accessory.context.model = device.deviceType;
|
|
1130
1131
|
accessory.context.deviceID = device.deviceId;
|
|
1131
|
-
accessory.context.firmwareRevision = device.firmware
|
|
1132
|
+
accessory.context.firmwareRevision = device.firmware;
|
|
1132
1133
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1133
1134
|
await this.connectionTypeNewAccessory(device, accessory);
|
|
1134
1135
|
// create the accessory handler for the newly create accessory
|
|
@@ -1158,7 +1159,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1158
1159
|
existingAccessory.context.model = device.remoteType;
|
|
1159
1160
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1160
1161
|
existingAccessory.displayName = device.deviceName;
|
|
1161
|
-
existingAccessory.context.firmwareRevision = device.firmware
|
|
1162
|
+
existingAccessory.context.firmwareRevision = device.firmware;
|
|
1162
1163
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1163
1164
|
await this.connectionTypeExistingIRAccessory(existingAccessory);
|
|
1164
1165
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -1178,7 +1179,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1178
1179
|
accessory.context.device = device;
|
|
1179
1180
|
accessory.context.model = device.remoteType;
|
|
1180
1181
|
accessory.context.deviceID = device.deviceId;
|
|
1181
|
-
accessory.context.firmwareRevision = device.firmware
|
|
1182
|
+
accessory.context.firmwareRevision = device.firmware;
|
|
1182
1183
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1183
1184
|
await this.connectionTypeNewIRAccessory(accessory);
|
|
1184
1185
|
// create the accessory handler for the newly create accessory
|
|
@@ -1215,7 +1216,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1215
1216
|
existingAccessory.context.model = device.remoteType;
|
|
1216
1217
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1217
1218
|
existingAccessory.displayName = device.deviceName;
|
|
1218
|
-
existingAccessory.context.firmwareRevision = device.firmware
|
|
1219
|
+
existingAccessory.context.firmwareRevision = device.firmware;
|
|
1219
1220
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1220
1221
|
await this.connectionTypeExistingIRAccessory(existingAccessory);
|
|
1221
1222
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -1238,7 +1239,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1238
1239
|
accessory.context.device = device;
|
|
1239
1240
|
accessory.context.model = device.remoteType;
|
|
1240
1241
|
accessory.context.deviceID = device.deviceId;
|
|
1241
|
-
accessory.context.firmwareRevision = device.firmware
|
|
1242
|
+
accessory.context.firmwareRevision = device.firmware;
|
|
1242
1243
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1243
1244
|
await this.connectionTypeNewIRAccessory(accessory);
|
|
1244
1245
|
// create the accessory handler for the newly create accessory
|
|
@@ -1270,7 +1271,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1270
1271
|
existingAccessory.context.model = device.remoteType;
|
|
1271
1272
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1272
1273
|
existingAccessory.displayName = device.deviceName;
|
|
1273
|
-
existingAccessory.context.firmwareRevision = device.firmware
|
|
1274
|
+
existingAccessory.context.firmwareRevision = device.firmware;
|
|
1274
1275
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1275
1276
|
await this.connectionTypeExistingIRAccessory(existingAccessory);
|
|
1276
1277
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -1293,7 +1294,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1293
1294
|
accessory.context.device = device;
|
|
1294
1295
|
accessory.context.model = device.remoteType;
|
|
1295
1296
|
accessory.context.deviceID = device.deviceId;
|
|
1296
|
-
accessory.context.firmwareRevision = device.firmware
|
|
1297
|
+
accessory.context.firmwareRevision = device.firmware;
|
|
1297
1298
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1298
1299
|
await this.connectionTypeNewIRAccessory(accessory);
|
|
1299
1300
|
// create the accessory handler for the newly create accessory
|
|
@@ -1325,7 +1326,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1325
1326
|
existingAccessory.context.model = device.remoteType;
|
|
1326
1327
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1327
1328
|
existingAccessory.displayName = device.deviceName;
|
|
1328
|
-
existingAccessory.context.firmwareRevision = device.firmware
|
|
1329
|
+
existingAccessory.context.firmwareRevision = device.firmware;
|
|
1329
1330
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1330
1331
|
await this.connectionTypeExistingIRAccessory(existingAccessory);
|
|
1331
1332
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -1348,7 +1349,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1348
1349
|
accessory.context.device = device;
|
|
1349
1350
|
accessory.context.model = device.remoteType;
|
|
1350
1351
|
accessory.context.deviceID = device.deviceId;
|
|
1351
|
-
accessory.context.firmwareRevision = device.firmware
|
|
1352
|
+
accessory.context.firmwareRevision = device.firmware;
|
|
1352
1353
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1353
1354
|
await this.connectionTypeNewIRAccessory(accessory);
|
|
1354
1355
|
// create the accessory handler for the newly create accessory
|
|
@@ -1380,7 +1381,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1380
1381
|
existingAccessory.context.model = device.remoteType;
|
|
1381
1382
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1382
1383
|
existingAccessory.displayName = device.deviceName;
|
|
1383
|
-
existingAccessory.context.firmwareRevision = device.firmware
|
|
1384
|
+
existingAccessory.context.firmwareRevision = device.firmware;
|
|
1384
1385
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1385
1386
|
await this.connectionTypeExistingIRAccessory(existingAccessory);
|
|
1386
1387
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -1403,7 +1404,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1403
1404
|
accessory.context.device = device;
|
|
1404
1405
|
accessory.context.model = device.remoteType;
|
|
1405
1406
|
accessory.context.deviceID = device.deviceId;
|
|
1406
|
-
accessory.context.firmwareRevision = device.firmware
|
|
1407
|
+
accessory.context.firmwareRevision = device.firmware;
|
|
1407
1408
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1408
1409
|
await this.connectionTypeNewIRAccessory(accessory);
|
|
1409
1410
|
// create the accessory handler for the newly create accessory
|
|
@@ -1435,7 +1436,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1435
1436
|
existingAccessory.context.model = device.remoteType;
|
|
1436
1437
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1437
1438
|
existingAccessory.displayName = device.deviceName;
|
|
1438
|
-
existingAccessory.context.firmwareRevision = device.firmware
|
|
1439
|
+
existingAccessory.context.firmwareRevision = device.firmware;
|
|
1439
1440
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1440
1441
|
await this.connectionTypeExistingIRAccessory(existingAccessory);
|
|
1441
1442
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -1458,7 +1459,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1458
1459
|
accessory.context.device = device;
|
|
1459
1460
|
accessory.context.model = device.remoteType;
|
|
1460
1461
|
accessory.context.deviceID = device.deviceId;
|
|
1461
|
-
accessory.context.firmwareRevision = device.firmware
|
|
1462
|
+
accessory.context.firmwareRevision = device.firmware;
|
|
1462
1463
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1463
1464
|
await this.connectionTypeNewIRAccessory(accessory);
|
|
1464
1465
|
// create the accessory handler for the newly create accessory
|
|
@@ -1490,7 +1491,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1490
1491
|
existingAccessory.context.model = device.remoteType;
|
|
1491
1492
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1492
1493
|
existingAccessory.displayName = device.deviceName;
|
|
1493
|
-
existingAccessory.context.firmwareRevision = device.firmware
|
|
1494
|
+
existingAccessory.context.firmwareRevision = device.firmware;
|
|
1494
1495
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1495
1496
|
await this.connectionTypeExistingIRAccessory(existingAccessory);
|
|
1496
1497
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -1513,7 +1514,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1513
1514
|
accessory.context.device = device;
|
|
1514
1515
|
accessory.context.model = device.remoteType;
|
|
1515
1516
|
accessory.context.deviceID = device.deviceId;
|
|
1516
|
-
accessory.context.firmwareRevision = device.firmware
|
|
1517
|
+
accessory.context.firmwareRevision = device.firmware;
|
|
1517
1518
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1518
1519
|
await this.connectionTypeNewIRAccessory(accessory);
|
|
1519
1520
|
// create the accessory handler for the newly create accessory
|
|
@@ -1545,7 +1546,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1545
1546
|
existingAccessory.context.model = device.remoteType;
|
|
1546
1547
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1547
1548
|
existingAccessory.displayName = device.deviceName;
|
|
1548
|
-
existingAccessory.context.firmwareRevision = device.firmware
|
|
1549
|
+
existingAccessory.context.firmwareRevision = device.firmware;
|
|
1549
1550
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1550
1551
|
await this.connectionTypeExistingIRAccessory(existingAccessory);
|
|
1551
1552
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -1568,7 +1569,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1568
1569
|
accessory.context.device = device;
|
|
1569
1570
|
accessory.context.model = device.remoteType;
|
|
1570
1571
|
accessory.context.deviceID = device.deviceId;
|
|
1571
|
-
accessory.context.firmwareRevision = device.firmware
|
|
1572
|
+
accessory.context.firmwareRevision = device.firmware;
|
|
1572
1573
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1573
1574
|
await this.connectionTypeNewIRAccessory(accessory);
|
|
1574
1575
|
// create the accessory handler for the newly create accessory
|
|
@@ -1600,7 +1601,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1600
1601
|
existingAccessory.context.model = device.remoteType;
|
|
1601
1602
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1602
1603
|
existingAccessory.displayName = device.deviceName;
|
|
1603
|
-
existingAccessory.context.firmwareRevision = device.firmware
|
|
1604
|
+
existingAccessory.context.firmwareRevision = device.firmware;
|
|
1604
1605
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1605
1606
|
await this.connectionTypeExistingIRAccessory(existingAccessory);
|
|
1606
1607
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -1623,7 +1624,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1623
1624
|
accessory.context.device = device;
|
|
1624
1625
|
accessory.context.model = device.remoteType;
|
|
1625
1626
|
accessory.context.deviceID = device.deviceId;
|
|
1626
|
-
accessory.context.firmwareRevision = device.firmware
|
|
1627
|
+
accessory.context.firmwareRevision = device.firmware;
|
|
1627
1628
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1628
1629
|
await this.connectionTypeNewIRAccessory(accessory);
|
|
1629
1630
|
// create the accessory handler for the newly create accessory
|