@switchbot/homebridge-switchbot 3.5.0-beta.63 → 3.5.0-beta.65
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 +15 -9
- package/dist/device/blindtilt.js.map +1 -1
- package/dist/device/bot.d.ts.map +1 -1
- package/dist/device/bot.js +37 -24
- package/dist/device/bot.js.map +1 -1
- package/dist/device/ceilinglight.d.ts.map +1 -1
- package/dist/device/ceilinglight.js +10 -6
- package/dist/device/ceilinglight.js.map +1 -1
- package/dist/device/colorbulb.d.ts.map +1 -1
- package/dist/device/colorbulb.js +7 -6
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/device/contact.d.ts.map +1 -1
- package/dist/device/contact.js +20 -13
- 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 +47 -18
- package/dist/device/device.js.map +1 -1
- package/dist/device/fan.d.ts.map +1 -1
- package/dist/device/fan.js +13 -8
- package/dist/device/fan.js.map +1 -1
- package/dist/device/hub.d.ts.map +1 -1
- package/dist/device/hub.js +15 -9
- package/dist/device/hub.js.map +1 -1
- package/dist/device/humidifier.d.ts.map +1 -1
- package/dist/device/humidifier.js +12 -7
- package/dist/device/humidifier.js.map +1 -1
- package/dist/device/iosensor.d.ts.map +1 -1
- package/dist/device/iosensor.js +16 -9
- package/dist/device/iosensor.js.map +1 -1
- package/dist/device/lightstrip.d.ts.map +1 -1
- package/dist/device/lightstrip.js +9 -5
- package/dist/device/lightstrip.js.map +1 -1
- package/dist/device/lock.d.ts.map +1 -1
- package/dist/device/lock.js +18 -11
- package/dist/device/lock.js.map +1 -1
- package/dist/device/meter.d.ts.map +1 -1
- package/dist/device/meter.js +14 -8
- package/dist/device/meter.js.map +1 -1
- package/dist/device/meterplus.d.ts.map +1 -1
- package/dist/device/meterplus.js +15 -9
- package/dist/device/meterplus.js.map +1 -1
- package/dist/device/motion.d.ts.map +1 -1
- package/dist/device/motion.js +15 -8
- package/dist/device/motion.js.map +1 -1
- package/dist/device/plug.d.ts.map +1 -1
- package/dist/device/plug.js +9 -5
- package/dist/device/plug.js.map +1 -1
- package/dist/device/robotvacuumcleaner.d.ts.map +1 -1
- package/dist/device/robotvacuumcleaner.js +12 -7
- package/dist/device/robotvacuumcleaner.js.map +1 -1
- package/dist/device/waterdetector.d.ts.map +1 -1
- package/dist/device/waterdetector.js +10 -5
- package/dist/device/waterdetector.js.map +1 -1
- package/dist/irdevice/airconditioner.d.ts.map +1 -1
- package/dist/irdevice/airconditioner.js +5 -5
- package/dist/irdevice/airconditioner.js.map +1 -1
- package/dist/irdevice/airpurifier.d.ts.map +1 -1
- package/dist/irdevice/airpurifier.js +6 -10
- package/dist/irdevice/airpurifier.js.map +1 -1
- package/dist/irdevice/camera.d.ts.map +1 -1
- package/dist/irdevice/camera.js +3 -5
- package/dist/irdevice/camera.js.map +1 -1
- package/dist/irdevice/fan.d.ts.map +1 -1
- package/dist/irdevice/fan.js +3 -6
- package/dist/irdevice/fan.js.map +1 -1
- package/dist/irdevice/light.d.ts.map +1 -1
- package/dist/irdevice/light.js +7 -13
- package/dist/irdevice/light.js.map +1 -1
- package/dist/irdevice/other.d.ts.map +1 -1
- package/dist/irdevice/other.js +34 -55
- package/dist/irdevice/other.js.map +1 -1
- package/dist/irdevice/tv.d.ts.map +1 -1
- package/dist/irdevice/tv.js +4 -8
- package/dist/irdevice/tv.js.map +1 -1
- package/dist/irdevice/vacuumcleaner.d.ts.map +1 -1
- package/dist/irdevice/vacuumcleaner.js +3 -5
- package/dist/irdevice/vacuumcleaner.js.map +1 -1
- package/dist/irdevice/waterheater.d.ts.map +1 -1
- package/dist/irdevice/waterheater.js +3 -5
- package/dist/irdevice/waterheater.js.map +1 -1
- package/package.json +1 -1
- package/src/device/blindtilt.ts +15 -9
- package/src/device/bot.ts +37 -24
- package/src/device/ceilinglight.ts +10 -6
- package/src/device/colorbulb.ts +7 -6
- package/src/device/contact.ts +20 -13
- package/src/device/curtain.ts +8 -7
- package/src/device/device.ts +44 -18
- package/src/device/fan.ts +13 -8
- package/src/device/hub.ts +15 -9
- package/src/device/humidifier.ts +12 -7
- package/src/device/iosensor.ts +17 -9
- package/src/device/lightstrip.ts +9 -5
- package/src/device/lock.ts +18 -11
- package/src/device/meter.ts +14 -8
- package/src/device/meterplus.ts +16 -9
- package/src/device/motion.ts +15 -8
- package/src/device/plug.ts +9 -5
- package/src/device/robotvacuumcleaner.ts +12 -7
- package/src/device/waterdetector.ts +10 -5
- package/src/irdevice/airconditioner.ts +5 -6
- package/src/irdevice/airpurifier.ts +6 -11
- package/src/irdevice/camera.ts +3 -5
- package/src/irdevice/fan.ts +3 -7
- package/src/irdevice/light.ts +7 -15
- package/src/irdevice/other.ts +34 -55
- package/src/irdevice/tv.ts +4 -8
- package/src/irdevice/vacuumcleaner.ts +3 -5
- package/src/irdevice/waterheater.ts +3 -5
|
@@ -18,14 +18,13 @@ export class VacuumCleaner extends irdeviceBase {
|
|
|
18
18
|
super(platform, accessory, device);
|
|
19
19
|
this.platform = platform;
|
|
20
20
|
// Initialize Switch Service
|
|
21
|
-
|
|
22
|
-
accessory.context.Switch = {};
|
|
23
|
-
}
|
|
21
|
+
accessory.context.Switch = accessory.context.Switch ?? {};
|
|
24
22
|
this.Switch = {
|
|
25
|
-
Name: accessory.context.Name ?? `${accessory.displayName} ${device.remoteType}`,
|
|
23
|
+
Name: accessory.context.Switch.Name ?? `${accessory.displayName} ${device.remoteType}`,
|
|
26
24
|
Service: accessory.getService(this.hap.Service.Switch) ?? accessory.addService(this.hap.Service.Switch),
|
|
27
25
|
On: accessory.context.On ?? false,
|
|
28
26
|
};
|
|
27
|
+
accessory.context.Switch = this.Switch;
|
|
29
28
|
this.Switch.Service
|
|
30
29
|
.setCharacteristic(this.hap.Characteristic.Name, this.Switch.Name)
|
|
31
30
|
.getCharacteristic(this.hap.Characteristic.On)
|
|
@@ -33,7 +32,6 @@ export class VacuumCleaner extends irdeviceBase {
|
|
|
33
32
|
return this.Switch.On;
|
|
34
33
|
})
|
|
35
34
|
.onSet(this.OnSet.bind(this));
|
|
36
|
-
accessory.context.Switch.Name = this.Switch.Name;
|
|
37
35
|
}
|
|
38
36
|
async OnSet(value) {
|
|
39
37
|
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} On: ${value}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vacuumcleaner.js","sourceRoot":"","sources":["../../src/irdevice/vacuumcleaner.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAM7C;;;;GAIG;AACH,MAAM,OAAO,aAAc,SAAQ,YAAY;IASlC;IARX,WAAW;IACH,MAAM,CAIZ;IAEF,YACW,QAA2B,EACpC,SAA4B,EAC5B,MAAkC;QAElC,KAAK,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;QAJ1B,aAAQ,GAAR,QAAQ,CAAmB;QAMpC,4BAA4B;QAC5B,
|
|
1
|
+
{"version":3,"file":"vacuumcleaner.js","sourceRoot":"","sources":["../../src/irdevice/vacuumcleaner.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAM7C;;;;GAIG;AACH,MAAM,OAAO,aAAc,SAAQ,YAAY;IASlC;IARX,WAAW;IACH,MAAM,CAIZ;IAEF,YACW,QAA2B,EACpC,SAA4B,EAC5B,M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sourceRoot":"","sources":["../../src/irdevice/waterheater.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAW,MAAM,YAAY,CAAC;AAElF;;;;GAIG;AACH,qBAAa,WAAY,SAAQ,YAAY;IASzC,QAAQ,CAAC,QAAQ,EAAE,iBAAiB;IAPtC,OAAO,CAAC,KAAK,CAIX;gBAGS,QAAQ,EAAE,iBAAiB,EACpC,SAAS,EAAE,iBAAiB,EAC5B,MAAM,EAAE,QAAQ,GAAG,eAAe;
|
|
1
|
+
{"version":3,"file":"waterheater.d.ts","sourceRoot":"","sources":["../../src/irdevice/waterheater.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAW,MAAM,YAAY,CAAC;AAElF;;;;GAIG;AACH,qBAAa,WAAY,SAAQ,YAAY;IASzC,QAAQ,CAAC,QAAQ,EAAE,iBAAiB;IAPtC,OAAO,CAAC,KAAK,CAIX;gBAGS,QAAQ,EAAE,iBAAiB,EACpC,SAAS,EAAE,iBAAiB,EAC5B,MAAM,EAAE,QAAQ,GAAG,eAAe;IAuB9B,SAAS,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAa1D;;;;;OAKG;IACG,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC;IAezC,yBAAyB,IAAI,OAAO,CAAC,IAAI,CAAC;IAe1C,WAAW,CAAC,UAAU,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAmC3C,4BAA4B,IAAI,OAAO,CAAC,IAAI,CAAC;IAW7C,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE;QAAE,CAAC,EAAE,GAAG,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAGjD"}
|
|
@@ -18,14 +18,13 @@ export class WaterHeater extends irdeviceBase {
|
|
|
18
18
|
super(platform, accessory, device);
|
|
19
19
|
this.platform = platform;
|
|
20
20
|
// Initialize Switch Service
|
|
21
|
-
|
|
22
|
-
accessory.context.Valve = {};
|
|
23
|
-
}
|
|
21
|
+
accessory.context.Valve = accessory.context.Valve ?? {};
|
|
24
22
|
this.Valve = {
|
|
25
|
-
Name: accessory.context.Name ?? `${accessory.displayName} ${device.remoteType}`,
|
|
23
|
+
Name: accessory.context.Valve.Name ?? `${accessory.displayName} ${device.remoteType}`,
|
|
26
24
|
Service: accessory.getService(this.hap.Service.Valve) ?? accessory.addService(this.hap.Service.Valve),
|
|
27
25
|
Active: accessory.context.Active ?? this.hap.Characteristic.Active.INACTIVE,
|
|
28
26
|
};
|
|
27
|
+
accessory.context.Valve = this.Valve;
|
|
29
28
|
this.Valve.Service
|
|
30
29
|
.setCharacteristic(this.hap.Characteristic.Name, accessory.displayName)
|
|
31
30
|
.setCharacteristic(this.hap.Characteristic.ValveType, this.hap.Characteristic.ValveType.GENERIC_VALVE)
|
|
@@ -34,7 +33,6 @@ export class WaterHeater extends irdeviceBase {
|
|
|
34
33
|
return this.Valve.Active;
|
|
35
34
|
})
|
|
36
35
|
.onSet(this.ActiveSet.bind(this));
|
|
37
|
-
accessory.context.Valve.Name = this.Valve.Name;
|
|
38
36
|
}
|
|
39
37
|
async ActiveSet(value) {
|
|
40
38
|
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Active: ${value}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"waterheater.js","sourceRoot":"","sources":["../../src/irdevice/waterheater.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAM7C;;;;GAIG;AACH,MAAM,OAAO,WAAY,SAAQ,YAAY;IAShC;IARX,WAAW;IACH,KAAK,CAIX;IAEF,YACW,QAA2B,EACpC,SAA4B,EAC5B,MAAkC;QAElC,KAAK,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;QAJ1B,aAAQ,GAAR,QAAQ,CAAmB;QAMpC,4BAA4B;QAC5B,
|
|
1
|
+
{"version":3,"file":"waterheater.js","sourceRoot":"","sources":["../../src/irdevice/waterheater.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAM7C;;;;GAIG;AACH,MAAM,OAAO,WAAY,SAAQ,YAAY;IAShC;IARX,WAAW;IACH,KAAK,CAIX;IAEF,YACW,QAA2B,EACpC,SAA4B,EAC5B,MAAkC;QAElC,KAAK,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;QAJ1B,aAAQ,GAAR,QAAQ,CAAmB;QAMpC,4BAA4B;QAC5B,SAAS,CAAC,OAAO,CAAC,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC;QACxD,IAAI,CAAC,KAAK,GAAG;YACX,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,GAAG,SAAS,CAAC,WAAW,IAAI,MAAM,CAAC,UAAU,EAAE;YACrF,OAAO,EAAE,SAAS,CAAC,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C,MAAM,EAAE,CAAC,CAAC;QAC9H,CAAC;IACH,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAc;QAC9B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC7E,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "SwitchBot",
|
|
3
3
|
"name": "@switchbot/homebridge-switchbot",
|
|
4
|
-
"version": "3.5.0-beta.
|
|
4
|
+
"version": "3.5.0-beta.65",
|
|
5
5
|
"description": "The SwitchBot plugin allows you to access your SwitchBot device(s) from HomeKit.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "SwitchBot",
|
package/src/device/blindtilt.ts
CHANGED
|
@@ -66,8 +66,8 @@ export class BlindTilt extends deviceBase {
|
|
|
66
66
|
this.blindTiltUpdateInProgress = false;
|
|
67
67
|
this.setNewTarget = false;
|
|
68
68
|
|
|
69
|
-
accessory.context.WindowCovering = accessory.context.WindowCovering ?? {};
|
|
70
69
|
// Initialize WindowCovering Service
|
|
70
|
+
accessory.context.WindowCovering = accessory.context.WindowCovering ?? {};
|
|
71
71
|
this.WindowCovering = {
|
|
72
72
|
Name: accessory.context.WindowCovering.Name ?? accessory.displayName,
|
|
73
73
|
Service: accessory.getService(this.hap.Service.WindowCovering) ?? accessory.addService(this.hap.Service.WindowCovering) as Service,
|
|
@@ -119,7 +119,6 @@ export class BlindTilt extends deviceBase {
|
|
|
119
119
|
return this.WindowCovering.TargetHorizontalTiltAngle;
|
|
120
120
|
})
|
|
121
121
|
.onSet(this.TargetHorizontalTiltAngleSet.bind(this));
|
|
122
|
-
accessory.context.WindowCovering.Name = this.WindowCovering.Name;
|
|
123
122
|
|
|
124
123
|
// Initialize WindowCovering CurrentHorizontalTiltAngle Characteristic
|
|
125
124
|
this.WindowCovering.Service
|
|
@@ -134,19 +133,20 @@ export class BlindTilt extends deviceBase {
|
|
|
134
133
|
});
|
|
135
134
|
|
|
136
135
|
// Initialize Battery Service
|
|
136
|
+
accessory.context.Battery = accessory.context.Battery ?? {};
|
|
137
137
|
this.Battery = {
|
|
138
|
-
Name: accessory.context.
|
|
138
|
+
Name: accessory.context.Battery.Name ?? `${accessory.displayName} Battery`,
|
|
139
139
|
Service: accessory.getService(this.hap.Service.Battery) ?? accessory.addService(this.hap.Service.Battery) as Service,
|
|
140
140
|
BatteryLevel: accessory.context.BatteryLevel ?? 100,
|
|
141
141
|
StatusLowBattery: this.hap.Characteristic.StatusLowBattery.BATTERY_LEVEL_NORMAL,
|
|
142
142
|
ChargingState: accessory.context.ChargingState ?? this.hap.Characteristic.ChargingState.NOT_CHARGING,
|
|
143
143
|
};
|
|
144
|
+
accessory.context.Battery = this.Battery as object;
|
|
144
145
|
|
|
145
146
|
// Initialize Battery Name Characteristic
|
|
146
147
|
this.Battery.Service
|
|
147
148
|
.setCharacteristic(this.hap.Characteristic.Name, this.Battery.Name)
|
|
148
149
|
.setCharacteristic(this.hap.Characteristic.ChargingState, this.hap.Characteristic.ChargingState.NOT_CHARGEABLE);
|
|
149
|
-
accessory.context.BatteryName = this.Battery.Name;
|
|
150
150
|
|
|
151
151
|
// Initialize LightSensor Service
|
|
152
152
|
if (device.blindTilt?.hide_lightsensor) {
|
|
@@ -154,11 +154,13 @@ export class BlindTilt extends deviceBase {
|
|
|
154
154
|
this.LightSensor!.Service = accessory.getService(this.hap.Service.LightSensor) as Service;
|
|
155
155
|
accessory.removeService(this.LightSensor!.Service);
|
|
156
156
|
} else {
|
|
157
|
+
accessory.context.LightSensor = accessory.context.LightSensor ?? {};
|
|
157
158
|
this.LightSensor = {
|
|
158
|
-
Name: accessory.context.
|
|
159
|
+
Name: accessory.context.LightSensor.Name ?? `${accessory.displayName} Light Sensor`,
|
|
159
160
|
Service: accessory.getService(this.hap.Service.LightSensor) ?? accessory.addService(this.hap.Service.LightSensor) as Service,
|
|
160
161
|
CurrentAmbientLightLevel: accessory.context.CurrentAmbientLightLevel ?? 0.0001,
|
|
161
162
|
};
|
|
163
|
+
accessory.context.LightSensor = this.LightSensor as object;
|
|
162
164
|
|
|
163
165
|
// Initialize LightSensor Characteristics
|
|
164
166
|
this.LightSensor.Service
|
|
@@ -168,7 +170,6 @@ export class BlindTilt extends deviceBase {
|
|
|
168
170
|
.onGet(() => {
|
|
169
171
|
return this.LightSensor?.CurrentAmbientLightLevel ?? 0.0001;
|
|
170
172
|
});
|
|
171
|
-
accessory.context.LightSensorName = this.LightSensor.Name;
|
|
172
173
|
}
|
|
173
174
|
|
|
174
175
|
// Retrieve initial values and updateHomekit
|
|
@@ -460,12 +461,17 @@ export class BlindTilt extends deviceBase {
|
|
|
460
461
|
const version = deviceStatus.body.version?.toString();
|
|
461
462
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Firmware Version: ${version?.replace(/^V|-.*$/g, '')}`);
|
|
462
463
|
if (deviceStatus.body.version) {
|
|
463
|
-
|
|
464
|
+
const replace = version?.replace(/^V|-.*$/g, '');
|
|
465
|
+
const match = replace?.match(/.{1,1}/g);
|
|
466
|
+
const blindTiltVersion = match?.join('.') ?? '0.0.0';
|
|
464
467
|
this.accessory
|
|
465
468
|
.getService(this.hap.Service.AccessoryInformation)!
|
|
466
|
-
.setCharacteristic(this.hap.Characteristic.
|
|
469
|
+
.setCharacteristic(this.hap.Characteristic.HardwareRevision, blindTiltVersion)
|
|
470
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, blindTiltVersion)
|
|
467
471
|
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
468
|
-
.updateValue(
|
|
472
|
+
.updateValue(blindTiltVersion);
|
|
473
|
+
this.accessory.context.deviceVersion = blindTiltVersion;
|
|
474
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceVersion: ${this.accessory.context.deviceVersion}`);
|
|
469
475
|
}
|
|
470
476
|
}
|
|
471
477
|
|
package/src/device/bot.ts
CHANGED
|
@@ -119,22 +119,24 @@ export class Bot extends deviceBase {
|
|
|
119
119
|
BatteryLevel: accessory.context.BatteryLevel ?? 100,
|
|
120
120
|
StatusLowBattery: accessory.context.StatusLowBattery ?? this.hap.Characteristic.StatusLowBattery.BATTERY_LEVEL_NORMAL,
|
|
121
121
|
};
|
|
122
|
+
accessory.context.Battery = this.Battery as object;
|
|
122
123
|
|
|
123
124
|
// Initialize Battery Characteristics
|
|
124
125
|
this.Battery.Service
|
|
125
126
|
.setCharacteristic(this.hap.Characteristic.Name, this.Battery.Name)
|
|
126
127
|
.setCharacteristic(this.hap.Characteristic.StatusLowBattery, this.Battery.StatusLowBattery)
|
|
127
128
|
.setCharacteristic(this.hap.Characteristic.ChargingState, this.hap.Characteristic.ChargingState.NOT_CHARGEABLE);
|
|
128
|
-
accessory.context.BatteryName = this.Battery.Name;
|
|
129
129
|
|
|
130
130
|
// deviceType
|
|
131
131
|
if (this.botDeviceType === 'switch') {
|
|
132
132
|
// Initialize Switch Service
|
|
133
|
+
accessory.context.Switch = accessory.context.Switch ?? {};
|
|
133
134
|
this.Switch = {
|
|
134
|
-
Name: accessory.context.Name ?? accessory.displayName,
|
|
135
|
+
Name: accessory.context.Switch.Name ?? accessory.displayName,
|
|
135
136
|
Service: accessory.getService(this.hap.Service.Switch) ?? accessory.addService(this.hap.Service.Switch) as Service,
|
|
136
137
|
On: accessory.context.On ?? false,
|
|
137
138
|
};
|
|
139
|
+
accessory.context.Switch = this.Switch as object;
|
|
138
140
|
this.debugWarnLog(`${this.device.deviceType}: ${accessory.displayName} Displaying as Switch`);
|
|
139
141
|
|
|
140
142
|
// Initialize Switch Characteristics
|
|
@@ -146,7 +148,6 @@ export class Bot extends deviceBase {
|
|
|
146
148
|
return this.Switch!.On;
|
|
147
149
|
})
|
|
148
150
|
.onSet(this.OnSet.bind(this));
|
|
149
|
-
accessory.context.Name = this.Switch.Name;
|
|
150
151
|
|
|
151
152
|
// Remove other services
|
|
152
153
|
this.removeFanService(accessory);
|
|
@@ -160,11 +161,13 @@ export class Bot extends deviceBase {
|
|
|
160
161
|
this.removeStatefulProgrammableSwitchService(accessory);
|
|
161
162
|
} else if (this.botDeviceType === 'garagedoor') {
|
|
162
163
|
// Initialize GarageDoor Service
|
|
164
|
+
accessory.context.GarageDoor = accessory.context.GarageDoor ?? {};
|
|
163
165
|
this.GarageDoor = {
|
|
164
|
-
Name: accessory.context.Name ?? accessory.displayName,
|
|
166
|
+
Name: accessory.context.GarageDoor.Name ?? accessory.displayName,
|
|
165
167
|
Service: accessory.getService(this.hap.Service.GarageDoorOpener) ?? accessory.addService(this.hap.Service.GarageDoorOpener) as Service,
|
|
166
168
|
On: accessory.context.On ?? false,
|
|
167
169
|
};
|
|
170
|
+
accessory.context.GarageDoor = this.GarageDoor as object;
|
|
168
171
|
this.debugWarnLog(`${this.device.deviceType}: ${accessory.displayName} Displaying as Garage Door Opener`);
|
|
169
172
|
|
|
170
173
|
// Initialize GarageDoor Characteristics
|
|
@@ -181,7 +184,6 @@ export class Bot extends deviceBase {
|
|
|
181
184
|
return this.GarageDoor!.On;
|
|
182
185
|
})
|
|
183
186
|
.onSet(this.OnSet.bind(this));
|
|
184
|
-
accessory.context.Name = this.GarageDoor.Name;
|
|
185
187
|
|
|
186
188
|
// Remove other services
|
|
187
189
|
this.removeFanService(accessory);
|
|
@@ -195,11 +197,13 @@ export class Bot extends deviceBase {
|
|
|
195
197
|
this.removeStatefulProgrammableSwitchService(accessory);
|
|
196
198
|
} else if (this.botDeviceType === 'door') {
|
|
197
199
|
// Initialize Door Service
|
|
200
|
+
accessory.context.Door = accessory.context.Door ?? {};
|
|
198
201
|
this.Door = {
|
|
199
|
-
Name: accessory.context.Name ?? accessory.displayName,
|
|
202
|
+
Name: accessory.context.Door.Name ?? accessory.displayName,
|
|
200
203
|
Service: accessory.getService(this.hap.Service.Door) ?? accessory.addService(this.hap.Service.Door) as Service,
|
|
201
204
|
On: accessory.context.On ?? false,
|
|
202
205
|
};
|
|
206
|
+
accessory.context.Door = this.Door as object;
|
|
203
207
|
this.debugWarnLog(`${this.device.deviceType}: ${accessory.displayName} Displaying as Door`);
|
|
204
208
|
|
|
205
209
|
// Initialize Door Characteristics
|
|
@@ -216,7 +220,6 @@ export class Bot extends deviceBase {
|
|
|
216
220
|
return this.Door!.On;
|
|
217
221
|
})
|
|
218
222
|
.onSet(this.OnSet.bind(this));
|
|
219
|
-
accessory.context.Name = this.Door.Name;
|
|
220
223
|
|
|
221
224
|
// Remove other services
|
|
222
225
|
this.removeFanService(accessory);
|
|
@@ -230,11 +233,13 @@ export class Bot extends deviceBase {
|
|
|
230
233
|
this.removeStatefulProgrammableSwitchService(accessory);
|
|
231
234
|
} else if (this.botDeviceType === 'window') {
|
|
232
235
|
// Initialize Window Service
|
|
236
|
+
accessory.context.Window = accessory.context.Window ?? {};
|
|
233
237
|
this.Window = {
|
|
234
|
-
Name: accessory.context.Name ?? accessory.displayName,
|
|
238
|
+
Name: accessory.context.Window.Name ?? accessory.displayName,
|
|
235
239
|
Service: accessory.getService(this.hap.Service.Window) ?? accessory.addService(this.hap.Service.Window) as Service,
|
|
236
240
|
On: accessory.context.On ?? false,
|
|
237
241
|
};
|
|
242
|
+
accessory.context.Window = this.Window as object;
|
|
238
243
|
this.debugWarnLog(`${this.device.deviceType}: ${accessory.displayName} Displaying as Window`);
|
|
239
244
|
|
|
240
245
|
// Initialize Window Characteristics
|
|
@@ -251,7 +256,6 @@ export class Bot extends deviceBase {
|
|
|
251
256
|
return this.Window!.On;
|
|
252
257
|
})
|
|
253
258
|
.onSet(this.OnSet.bind(this));
|
|
254
|
-
accessory.context.Name = this.Window.Name;
|
|
255
259
|
|
|
256
260
|
// Remove other services
|
|
257
261
|
this.removeFanService(accessory);
|
|
@@ -265,11 +269,13 @@ export class Bot extends deviceBase {
|
|
|
265
269
|
this.removeStatefulProgrammableSwitchService(accessory);
|
|
266
270
|
} else if (this.botDeviceType === 'windowcovering') {
|
|
267
271
|
// Initialize WindowCovering Service
|
|
272
|
+
accessory.context.WindowCovering = accessory.context.WindowCovering ?? {};
|
|
268
273
|
this.WindowCovering = {
|
|
269
|
-
Name: accessory.context.Name ?? accessory.displayName,
|
|
274
|
+
Name: accessory.context.WindowCovering.Name ?? accessory.displayName,
|
|
270
275
|
Service: accessory.getService(this.hap.Service.WindowCovering) ?? accessory.addService(this.hap.Service.WindowCovering) as Service,
|
|
271
276
|
On: accessory.context.On ?? false,
|
|
272
277
|
};
|
|
278
|
+
accessory.context.WindowCovering = this.WindowCovering as object;
|
|
273
279
|
this.debugWarnLog(`${this.device.deviceType}: ${accessory.displayName} Displaying as Window Covering`);
|
|
274
280
|
|
|
275
281
|
// Initialize WindowCovering Characteristics
|
|
@@ -286,7 +292,6 @@ export class Bot extends deviceBase {
|
|
|
286
292
|
return this.WindowCovering!.On;
|
|
287
293
|
})
|
|
288
294
|
.onSet(this.OnSet.bind(this));
|
|
289
|
-
accessory.context.Name = this.WindowCovering.Name;
|
|
290
295
|
|
|
291
296
|
// Remove other services
|
|
292
297
|
this.removeFanService(accessory);
|
|
@@ -300,11 +305,13 @@ export class Bot extends deviceBase {
|
|
|
300
305
|
this.removeStatefulProgrammableSwitchService(accessory);
|
|
301
306
|
} else if (this.botDeviceType === 'lock') {
|
|
302
307
|
// Initialize Lock Service
|
|
308
|
+
accessory.context.LockMechanism = accessory.context.LockMechanism ?? {};
|
|
303
309
|
this.LockMechanism = {
|
|
304
|
-
Name: accessory.context.Name ?? accessory.displayName,
|
|
310
|
+
Name: accessory.context.LockMechanism.Name ?? accessory.displayName,
|
|
305
311
|
Service: accessory.getService(this.hap.Service.LockMechanism) ?? accessory.addService(this.hap.Service.LockMechanism) as Service,
|
|
306
312
|
On: accessory.context.On ?? false,
|
|
307
313
|
};
|
|
314
|
+
accessory.context.LockMechanism = this.LockMechanism as object;
|
|
308
315
|
this.debugWarnLog(`${this.device.deviceType}: ${accessory.displayName} Displaying as Lock`);
|
|
309
316
|
|
|
310
317
|
// Initialize Lock Characteristics
|
|
@@ -315,7 +322,6 @@ export class Bot extends deviceBase {
|
|
|
315
322
|
return this.LockMechanism!.On;
|
|
316
323
|
})
|
|
317
324
|
.onSet(this.OnSet.bind(this));
|
|
318
|
-
accessory.context.Name = this.LockMechanism.Name;
|
|
319
325
|
|
|
320
326
|
// Remove other services
|
|
321
327
|
this.removeFanService(accessory);
|
|
@@ -329,11 +335,13 @@ export class Bot extends deviceBase {
|
|
|
329
335
|
this.removeStatefulProgrammableSwitchService(accessory);
|
|
330
336
|
} else if (this.botDeviceType === 'faucet') {
|
|
331
337
|
// Initialize Faucet Service
|
|
338
|
+
accessory.context.Faucet = accessory.context.Faucet ?? {};
|
|
332
339
|
this.Faucet = {
|
|
333
|
-
Name: accessory.context.Name ?? accessory.displayName,
|
|
340
|
+
Name: accessory.context.Faucet.Name ?? accessory.displayName,
|
|
334
341
|
Service: accessory.getService(this.hap.Service.Faucet) ?? accessory.addService(this.hap.Service.Faucet) as Service,
|
|
335
342
|
On: accessory.context.On ?? false,
|
|
336
343
|
};
|
|
344
|
+
accessory.context.Faucet = this.Faucet as object;
|
|
337
345
|
this.debugWarnLog(`${this.device.deviceType}: ${accessory.displayName} Displaying as Faucet`);
|
|
338
346
|
|
|
339
347
|
// Initialize Faucet Characteristics
|
|
@@ -344,7 +352,6 @@ export class Bot extends deviceBase {
|
|
|
344
352
|
return this.Faucet!.On;
|
|
345
353
|
})
|
|
346
354
|
.onSet(this.OnSet.bind(this));
|
|
347
|
-
accessory.context.Name = this.Faucet.Name;
|
|
348
355
|
|
|
349
356
|
// Remove other services
|
|
350
357
|
this.removeFanService(accessory);
|
|
@@ -358,11 +365,13 @@ export class Bot extends deviceBase {
|
|
|
358
365
|
this.removeStatefulProgrammableSwitchService(accessory);
|
|
359
366
|
} else if (this.botDeviceType === 'fan') {
|
|
360
367
|
// Initialize Fan Service
|
|
368
|
+
accessory.context.Fan = accessory.context.Fan ?? {};
|
|
361
369
|
this.Fan = {
|
|
362
|
-
Name: accessory.context.Name ?? accessory.displayName,
|
|
370
|
+
Name: accessory.context.Fan.Name ?? accessory.displayName,
|
|
363
371
|
Service: accessory.getService(this.hap.Service.Fanv2) ?? accessory.addService(this.hap.Service.Fanv2) as Service,
|
|
364
372
|
On: accessory.context.On ?? false,
|
|
365
373
|
};
|
|
374
|
+
accessory.context.Fan = this.Fan as object;
|
|
366
375
|
this.debugWarnLog(`${this.device.deviceType}: ${accessory.displayName} Displaying as Fan`);
|
|
367
376
|
|
|
368
377
|
// Initialize Fan Characteristics
|
|
@@ -373,7 +382,6 @@ export class Bot extends deviceBase {
|
|
|
373
382
|
return this.Fan!.On;
|
|
374
383
|
})
|
|
375
384
|
.onSet(this.OnSet.bind(this));
|
|
376
|
-
accessory.context.Name = this.Fan.Name;
|
|
377
385
|
|
|
378
386
|
// Remove other services
|
|
379
387
|
this.removeLockService(accessory);
|
|
@@ -387,12 +395,14 @@ export class Bot extends deviceBase {
|
|
|
387
395
|
this.removeStatefulProgrammableSwitchService(accessory);
|
|
388
396
|
} else if (this.botDeviceType === 'stateful') {
|
|
389
397
|
// Initialize StatefulProgrammableSwitch Service
|
|
398
|
+
accessory.context.StatefulProgrammableSwitch = accessory.context.StatefulProgrammableSwitch ?? {};
|
|
390
399
|
this.StatefulProgrammableSwitch = {
|
|
391
|
-
Name: accessory.context.Name ?? accessory.displayName,
|
|
400
|
+
Name: accessory.context.StatefulProgrammableSwitch.Name ?? accessory.displayName,
|
|
392
401
|
Service: accessory.getService(this.hap.Service.StatefulProgrammableSwitch)
|
|
393
402
|
?? accessory.addService(this.hap.Service.StatefulProgrammableSwitch) as Service,
|
|
394
403
|
On: accessory.context.On ?? false,
|
|
395
404
|
};
|
|
405
|
+
accessory.context.StatefulProgrammableSwitch = this.StatefulProgrammableSwitch as object;
|
|
396
406
|
this.debugWarnLog(`${this.device.deviceType}: ${accessory.displayName} Displaying as Stateful Programmable Switch`);
|
|
397
407
|
|
|
398
408
|
// Initialize StatefulProgrammableSwitch Characteristics
|
|
@@ -403,7 +413,6 @@ export class Bot extends deviceBase {
|
|
|
403
413
|
return this.StatefulProgrammableSwitch!.On;
|
|
404
414
|
})
|
|
405
415
|
.onSet(this.OnSet.bind(this));
|
|
406
|
-
accessory.context.Name = this.StatefulProgrammableSwitch.Name;
|
|
407
416
|
|
|
408
417
|
// Remove other services
|
|
409
418
|
this.removeFanService(accessory);
|
|
@@ -417,11 +426,13 @@ export class Bot extends deviceBase {
|
|
|
417
426
|
this.removeWindowCoveringService(accessory);
|
|
418
427
|
} else {
|
|
419
428
|
// Initialize Switch property
|
|
429
|
+
accessory.context.Outlet = accessory.context.Outlet ?? {};
|
|
420
430
|
this.Outlet = {
|
|
421
|
-
Name: accessory.context.Name ?? accessory.displayName,
|
|
431
|
+
Name: accessory.context.Outlet.Name ?? accessory.displayName,
|
|
422
432
|
Service: accessory.getService(this.hap.Service.Outlet) ?? accessory.addService(this.hap.Service.Outlet) as Service,
|
|
423
433
|
On: accessory.context.On ?? false,
|
|
424
434
|
};
|
|
435
|
+
accessory.context.Outlet = this.Outlet as object;
|
|
425
436
|
this.debugWarnLog(`${this.device.deviceType}: ${accessory.displayName} Displaying as Outlet`);
|
|
426
437
|
|
|
427
438
|
// Initialize Outlet Characteristics
|
|
@@ -432,7 +443,6 @@ export class Bot extends deviceBase {
|
|
|
432
443
|
return this.Outlet!.On;
|
|
433
444
|
})
|
|
434
445
|
.onSet(this.OnSet.bind(this));
|
|
435
|
-
accessory.context.Name = this.Outlet.Name;
|
|
436
446
|
|
|
437
447
|
// Remove other services
|
|
438
448
|
this.removeFanService(accessory);
|
|
@@ -582,12 +592,15 @@ export class Bot extends deviceBase {
|
|
|
582
592
|
const version = deviceStatus.body.version?.toString();
|
|
583
593
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Firmware Version: ${version?.replace(/^V|-.*$/g, '')}`);
|
|
584
594
|
if (deviceStatus.body.version) {
|
|
585
|
-
|
|
595
|
+
const deviceVersion = version?.replace(/^V|-.*$/g, '') ?? '0.0.0';
|
|
586
596
|
this.accessory
|
|
587
597
|
.getService(this.hap.Service.AccessoryInformation)!
|
|
588
|
-
.setCharacteristic(this.hap.Characteristic.
|
|
598
|
+
.setCharacteristic(this.hap.Characteristic.HardwareRevision, deviceVersion)
|
|
599
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
|
|
589
600
|
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
590
|
-
.updateValue(
|
|
601
|
+
.updateValue(deviceVersion);
|
|
602
|
+
this.accessory.context.deviceVersion = deviceVersion;
|
|
603
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceVersion: ${this.accessory.context.deviceVersion}`);
|
|
591
604
|
}
|
|
592
605
|
}
|
|
593
606
|
|
|
@@ -51,9 +51,10 @@ export class CeilingLight extends deviceBase {
|
|
|
51
51
|
this.doCeilingLightUpdate = new Subject();
|
|
52
52
|
this.ceilingLightUpdateInProgress = false;
|
|
53
53
|
|
|
54
|
-
// Initialize LightBulb
|
|
54
|
+
// Initialize LightBulb Service
|
|
55
|
+
accessory.context.LightBulb = accessory.context.LightBulb ?? {};
|
|
55
56
|
this.LightBulb = {
|
|
56
|
-
Name: accessory.context.
|
|
57
|
+
Name: accessory.context.LightBul.bName ?? accessory.displayName,
|
|
57
58
|
Service: accessory.getService(this.hap.Service.Lightbulb) ?? accessory.addService(this.hap.Service.Lightbulb) as Service,
|
|
58
59
|
On: accessory.context.On ?? false,
|
|
59
60
|
Hue: accessory.context.Hue ?? 0,
|
|
@@ -61,6 +62,7 @@ export class CeilingLight extends deviceBase {
|
|
|
61
62
|
Brightness: accessory.context.Brightness ?? 0,
|
|
62
63
|
ColorTemperature: accessory.context.ColorTemperature ?? 140,
|
|
63
64
|
};
|
|
65
|
+
accessory.context.LightBulb = this.LightBulb as object;
|
|
64
66
|
|
|
65
67
|
// Adaptive Lighting
|
|
66
68
|
if (this.adaptiveLightingShift === -1 && accessory.context.adaptiveLighting) {
|
|
@@ -141,7 +143,6 @@ export class CeilingLight extends deviceBase {
|
|
|
141
143
|
return this.LightBulb.Saturation;
|
|
142
144
|
})
|
|
143
145
|
.onSet(this.SaturationSet.bind(this));
|
|
144
|
-
accessory.context.LightBulbName = this.LightBulb.Name;
|
|
145
146
|
|
|
146
147
|
// Retrieve initial values and updateHomekit
|
|
147
148
|
this.refreshStatus();
|
|
@@ -294,12 +295,15 @@ export class CeilingLight extends deviceBase {
|
|
|
294
295
|
const version = deviceStatus.body.version?.toString();
|
|
295
296
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Firmware Version: ${version?.replace(/^V|-.*$/g, '')}`);
|
|
296
297
|
if (deviceStatus.body.version) {
|
|
297
|
-
|
|
298
|
+
const deviceVersion = version?.replace(/^V|-.*$/g, '') ?? '0.0.0';
|
|
298
299
|
this.accessory
|
|
299
300
|
.getService(this.hap.Service.AccessoryInformation)!
|
|
300
|
-
.setCharacteristic(this.hap.Characteristic.
|
|
301
|
+
.setCharacteristic(this.hap.Characteristic.HardwareRevision, deviceVersion)
|
|
302
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
|
|
301
303
|
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
302
|
-
.updateValue(
|
|
304
|
+
.updateValue(deviceVersion);
|
|
305
|
+
this.accessory.context.deviceVersion = deviceVersion;
|
|
306
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceVersion: ${this.accessory.context.deviceVersion}`);
|
|
303
307
|
}
|
|
304
308
|
}
|
|
305
309
|
|
package/src/device/colorbulb.ts
CHANGED
|
@@ -51,8 +51,8 @@ export class ColorBulb extends deviceBase {
|
|
|
51
51
|
this.doColorBulbUpdate = new Subject();
|
|
52
52
|
this.colorBulbUpdateInProgress = false;
|
|
53
53
|
|
|
54
|
-
accessory.context.LightBulb = accessory.context.LightBulb ?? {};
|
|
55
54
|
// Initialize LightBulb property
|
|
55
|
+
accessory.context.LightBulb = accessory.context.LightBulb ?? {};
|
|
56
56
|
this.LightBulb = {
|
|
57
57
|
Name: accessory.context.LightBulb.Name ?? accessory.displayName,
|
|
58
58
|
Service: accessory.getService(this.hap.Service.Lightbulb) ?? accessory.addService(this.hap.Service.Lightbulb) as Service,
|
|
@@ -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) {
|
|
@@ -140,7 +139,6 @@ export class ColorBulb extends deviceBase {
|
|
|
140
139
|
return this.LightBulb.Saturation;
|
|
141
140
|
})
|
|
142
141
|
.onSet(this.SaturationSet.bind(this));
|
|
143
|
-
accessory.context.LightBulb.Name = this.LightBulb.Name;
|
|
144
142
|
|
|
145
143
|
// Retrieve initial values and updateHomekit
|
|
146
144
|
this.refreshStatus();
|
|
@@ -351,12 +349,15 @@ export class ColorBulb extends deviceBase {
|
|
|
351
349
|
const version = deviceStatus.body.version?.toString();
|
|
352
350
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Firmware Version: ${version?.replace(/^V|-.*$/g, '')}`);
|
|
353
351
|
if (deviceStatus.body.version) {
|
|
354
|
-
|
|
352
|
+
const deviceVersion = version?.replace(/^V|-.*$/g, '') ?? '0.0.0';
|
|
355
353
|
this.accessory
|
|
356
354
|
.getService(this.hap.Service.AccessoryInformation)!
|
|
357
|
-
.setCharacteristic(this.hap.Characteristic.
|
|
355
|
+
.setCharacteristic(this.hap.Characteristic.HardwareRevision, deviceVersion)
|
|
356
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, deviceVersion)
|
|
358
357
|
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
359
|
-
.updateValue(
|
|
358
|
+
.updateValue(deviceVersion);
|
|
359
|
+
this.accessory.context.deviceVersion = deviceVersion;
|
|
360
|
+
this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceVersion: ${this.accessory.context.deviceVersion}`);
|
|
360
361
|
}
|
|
361
362
|
}
|
|
362
363
|
|