@switchbot/homebridge-switchbot 3.5.0-beta.36 → 3.5.0-beta.37
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 +8 -6
- package/dist/device/blindtilt.js.map +1 -1
- package/dist/device/bot.d.ts.map +1 -1
- package/dist/device/bot.js +8 -6
- package/dist/device/bot.js.map +1 -1
- package/dist/device/ceilinglight.d.ts.map +1 -1
- package/dist/device/ceilinglight.js +8 -6
- package/dist/device/ceilinglight.js.map +1 -1
- package/dist/device/colorbulb.d.ts.map +1 -1
- package/dist/device/colorbulb.js +8 -6
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/device/contact.d.ts.map +1 -1
- package/dist/device/contact.js +8 -6
- package/dist/device/contact.js.map +1 -1
- package/dist/device/curtain.d.ts.map +1 -1
- package/dist/device/curtain.js +8 -6
- package/dist/device/curtain.js.map +1 -1
- package/dist/device/device.d.ts.map +1 -1
- package/dist/device/device.js +0 -2
- package/dist/device/device.js.map +1 -1
- package/dist/device/fan.d.ts.map +1 -1
- package/dist/device/fan.js +16 -12
- package/dist/device/fan.js.map +1 -1
- package/dist/device/hub.d.ts.map +1 -1
- package/dist/device/hub.js +8 -6
- package/dist/device/hub.js.map +1 -1
- package/dist/device/humidifier.d.ts.map +1 -1
- package/dist/device/humidifier.js +8 -6
- package/dist/device/humidifier.js.map +1 -1
- package/dist/device/iosensor.d.ts.map +1 -1
- package/dist/device/iosensor.js +8 -6
- package/dist/device/iosensor.js.map +1 -1
- package/dist/device/lightstrip.d.ts.map +1 -1
- package/dist/device/lightstrip.js +8 -6
- package/dist/device/lightstrip.js.map +1 -1
- package/dist/device/lock.d.ts.map +1 -1
- package/dist/device/lock.js +8 -6
- package/dist/device/lock.js.map +1 -1
- package/dist/device/meter.d.ts.map +1 -1
- package/dist/device/meter.js +8 -6
- package/dist/device/meter.js.map +1 -1
- package/dist/device/meterplus.d.ts.map +1 -1
- package/dist/device/meterplus.js +8 -6
- package/dist/device/meterplus.js.map +1 -1
- package/dist/device/motion.d.ts.map +1 -1
- package/dist/device/motion.js +8 -6
- package/dist/device/motion.js.map +1 -1
- package/dist/device/plug.d.ts.map +1 -1
- package/dist/device/plug.js +8 -6
- package/dist/device/plug.js.map +1 -1
- package/dist/device/robotvacuumcleaner.d.ts.map +1 -1
- package/dist/device/robotvacuumcleaner.js +8 -6
- package/dist/device/robotvacuumcleaner.js.map +1 -1
- package/dist/device/waterdetector.d.ts.map +1 -1
- package/dist/device/waterdetector.js +8 -6
- package/dist/device/waterdetector.js.map +1 -1
- package/package.json +1 -1
- package/src/device/blindtilt.ts +4 -2
- package/src/device/bot.ts +32 -30
- package/src/device/ceilinglight.ts +8 -6
- package/src/device/colorbulb.ts +8 -6
- package/src/device/contact.ts +8 -6
- package/src/device/curtain.ts +8 -6
- package/src/device/device.ts +0 -2
- package/src/device/fan.ts +16 -12
- package/src/device/hub.ts +10 -8
- package/src/device/humidifier.ts +8 -6
- package/src/device/iosensor.ts +8 -6
- package/src/device/lightstrip.ts +8 -6
- package/src/device/lock.ts +8 -6
- package/src/device/meter.ts +8 -6
- package/src/device/meterplus.ts +8 -6
- package/src/device/motion.ts +8 -6
- package/src/device/plug.ts +8 -6
- package/src/device/robotvacuumcleaner.ts +8 -6
- package/src/device/waterdetector.ts +8 -6
package/src/device/blindtilt.ts
CHANGED
|
@@ -263,7 +263,7 @@ export class BlindTilt extends deviceBase {
|
|
|
263
263
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Stopped`);
|
|
264
264
|
}
|
|
265
265
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} CurrentPosition: ${this.WindowCovering.CurrentPosition},`
|
|
266
|
-
|
|
266
|
+
+ ` TargetPosition: ${this.WindowCovering.TargetPosition}, PositionState: ${this.WindowCovering.PositionState},`);
|
|
267
267
|
|
|
268
268
|
if (!this.device.blindTilt?.hide_lightsensor) {
|
|
269
269
|
const set_minLux = await this.minLux();
|
|
@@ -436,12 +436,14 @@ export class BlindTilt extends deviceBase {
|
|
|
436
436
|
+ ` StatusLowBattery: ${this.Battery.StatusLowBattery}`);
|
|
437
437
|
|
|
438
438
|
// FirmwareRevision
|
|
439
|
-
|
|
439
|
+
if (deviceStatus.body.version) {
|
|
440
|
+
this.accessory.context.FirmwareRevision = deviceStatus.body.version;
|
|
440
441
|
this.accessory
|
|
441
442
|
.getService(this.hap.Service.AccessoryInformation)!
|
|
442
443
|
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, this.accessory.context.FirmwareRevision)
|
|
443
444
|
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
444
445
|
.updateValue(this.accessory.context.FirmwareRevision);
|
|
446
|
+
}
|
|
445
447
|
}
|
|
446
448
|
|
|
447
449
|
async refreshStatus(): Promise<void> {
|
package/src/device/bot.ts
CHANGED
|
@@ -519,12 +519,14 @@ export class Bot extends deviceBase {
|
|
|
519
519
|
+ ` StatusLowBattery: ${this.Battery.StatusLowBattery}`);
|
|
520
520
|
|
|
521
521
|
// FirmwareRevision
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
522
|
+
if (deviceStatus.body.version) {
|
|
523
|
+
this.accessory.context.FirmwareRevision = deviceStatus.body.version;
|
|
524
|
+
this.accessory
|
|
525
|
+
.getService(this.hap.Service.AccessoryInformation)!
|
|
526
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, this.accessory.context.FirmwareRevision)
|
|
527
|
+
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
528
|
+
.updateValue(this.accessory.context.FirmwareRevision);
|
|
529
|
+
}
|
|
528
530
|
}
|
|
529
531
|
|
|
530
532
|
/**
|
|
@@ -1065,36 +1067,36 @@ export class Bot extends deviceBase {
|
|
|
1065
1067
|
async removeOutletService(accessory: PlatformAccessory): Promise<void> {
|
|
1066
1068
|
// If outletService still present, then remove first
|
|
1067
1069
|
if (this.Outlet?.Service) {
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1070
|
+
this.Outlet!.Service = this.accessory.getService(this.hap.Service.Outlet) as Service;
|
|
1071
|
+
this.warnLog(`${this.device.deviceType}: ${accessory.displayName} Removing Leftover Outlet Service`);
|
|
1072
|
+
accessory.removeService(this.Outlet!.Service);
|
|
1071
1073
|
}
|
|
1072
1074
|
}
|
|
1073
1075
|
|
|
1074
1076
|
async removeGarageDoorService(accessory: PlatformAccessory): Promise<void> {
|
|
1075
1077
|
// If garageDoorService still present, then remove first
|
|
1076
1078
|
if (this.GarageDoor?.Service) {
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1079
|
+
this.GarageDoor!.Service = this.accessory.getService(this.hap.Service.GarageDoorOpener) as Service;
|
|
1080
|
+
this.warnLog(`${this.device.deviceType}: ${accessory.displayName} Removing Leftover Garage Door Service`);
|
|
1081
|
+
accessory.removeService(this.GarageDoor!.Service);
|
|
1080
1082
|
}
|
|
1081
1083
|
}
|
|
1082
1084
|
|
|
1083
1085
|
async removeDoorService(accessory: PlatformAccessory): Promise<void> {
|
|
1084
1086
|
// If doorService still present, then remove first
|
|
1085
1087
|
if (this.Door?.Service) {
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1088
|
+
this.Door!.Service = this.accessory.getService(this.hap.Service.Door) as Service;
|
|
1089
|
+
this.warnLog(`${this.device.deviceType}: ${accessory.displayName} Removing Leftover Door Service`);
|
|
1090
|
+
accessory.removeService(this.Door!.Service);
|
|
1089
1091
|
}
|
|
1090
1092
|
}
|
|
1091
1093
|
|
|
1092
1094
|
async removeLockService(accessory: PlatformAccessory): Promise<void> {
|
|
1093
1095
|
// If lockService still present, then remove first
|
|
1094
1096
|
if (this.Lock?.Service) {
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1097
|
+
this.Lock!.Service = this.accessory.getService(this.hap.Service.LockMechanism) as Service;
|
|
1098
|
+
this.warnLog(`${this.device.deviceType}: ${accessory.displayName} Removing Leftover Lock Service`);
|
|
1099
|
+
accessory.removeService(this.Lock!.Service);
|
|
1098
1100
|
}
|
|
1099
1101
|
}
|
|
1100
1102
|
|
|
@@ -1110,27 +1112,27 @@ export class Bot extends deviceBase {
|
|
|
1110
1112
|
async removeFanService(accessory: PlatformAccessory): Promise<void> {
|
|
1111
1113
|
// If fanService still present, then remove first
|
|
1112
1114
|
if (this.Fan?.Service) {
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1115
|
+
this.Fan!.Service = this.accessory.getService(this.hap.Service.Fanv2) as Service;
|
|
1116
|
+
this.warnLog(`${this.device.deviceType}: ${accessory.displayName} Removing Leftover Fan Service`);
|
|
1117
|
+
accessory.removeService(this.Fan!.Service);
|
|
1116
1118
|
}
|
|
1117
1119
|
}
|
|
1118
1120
|
|
|
1119
1121
|
async removeWindowService(accessory: PlatformAccessory): Promise<void> {
|
|
1120
1122
|
// If windowService still present, then remove first
|
|
1121
1123
|
if (this.Window?.Service) {
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1124
|
+
this.Window!.Service = this.accessory.getService(this.hap.Service.Window) as Service;
|
|
1125
|
+
this.warnLog(`${this.device.deviceType}: ${accessory.displayName} Removing Leftover Window Service`);
|
|
1126
|
+
accessory.removeService(this.Window!.Service);
|
|
1125
1127
|
}
|
|
1126
1128
|
}
|
|
1127
1129
|
|
|
1128
1130
|
async removeWindowCoveringService(accessory: PlatformAccessory): Promise<void> {
|
|
1129
1131
|
// If windowCoveringService still present, then remove first
|
|
1130
1132
|
if (this.WindowCovering?.Service) {
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1133
|
+
this.WindowCovering!.Service = this.accessory.getService(this.hap.Service.WindowCovering) as Service;
|
|
1134
|
+
this.warnLog(`${this.device.deviceType}: ${accessory.displayName} Removing Leftover Window Covering Service`);
|
|
1135
|
+
accessory.removeService(this.WindowCovering!.Service);
|
|
1134
1136
|
}
|
|
1135
1137
|
}
|
|
1136
1138
|
|
|
@@ -1146,9 +1148,9 @@ export class Bot extends deviceBase {
|
|
|
1146
1148
|
async removeSwitchService(accessory: PlatformAccessory): Promise<void> {
|
|
1147
1149
|
// If switchService still present, then remove first
|
|
1148
1150
|
if (this.Switch?.Service) {
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1151
|
+
this.Switch!.Service = this.accessory.getService(this.hap.Service.Switch) as Service;
|
|
1152
|
+
this.warnLog(`${this.device.deviceType}: ${accessory.displayName} Removing Leftover Switch Service`);
|
|
1153
|
+
accessory.removeService(this.Switch!.Service);
|
|
1152
1154
|
}
|
|
1153
1155
|
}
|
|
1154
1156
|
|
|
@@ -288,12 +288,14 @@ export class CeilingLight extends deviceBase {
|
|
|
288
288
|
}
|
|
289
289
|
|
|
290
290
|
// FirmwareRevision
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
291
|
+
if (deviceStatus.body.version) {
|
|
292
|
+
this.accessory.context.FirmwareRevision = deviceStatus.body.version;
|
|
293
|
+
this.accessory
|
|
294
|
+
.getService(this.hap.Service.AccessoryInformation)!
|
|
295
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, this.accessory.context.FirmwareRevision)
|
|
296
|
+
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
297
|
+
.updateValue(this.accessory.context.FirmwareRevision);
|
|
298
|
+
}
|
|
297
299
|
}
|
|
298
300
|
|
|
299
301
|
/**
|
package/src/device/colorbulb.ts
CHANGED
|
@@ -349,12 +349,14 @@ export class ColorBulb extends deviceBase {
|
|
|
349
349
|
}
|
|
350
350
|
|
|
351
351
|
// FirmwareRevision
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
352
|
+
if (deviceStatus.body.version) {
|
|
353
|
+
this.accessory.context.FirmwareRevision = deviceStatus.body.version;
|
|
354
|
+
this.accessory
|
|
355
|
+
.getService(this.hap.Service.AccessoryInformation)!
|
|
356
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, this.accessory.context.FirmwareRevision)
|
|
357
|
+
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
358
|
+
.updateValue(this.accessory.context.FirmwareRevision);
|
|
359
|
+
}
|
|
358
360
|
}
|
|
359
361
|
|
|
360
362
|
/**
|
package/src/device/contact.ts
CHANGED
|
@@ -279,12 +279,14 @@ export class Contact extends deviceBase {
|
|
|
279
279
|
+ `StatusLowBattery: ${this.Battery.StatusLowBattery}`);
|
|
280
280
|
|
|
281
281
|
// FirmwareRevision
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
282
|
+
if (deviceStatus.body.version) {
|
|
283
|
+
this.accessory.context.FirmwareRevision = deviceStatus.body.version;
|
|
284
|
+
this.accessory
|
|
285
|
+
.getService(this.hap.Service.AccessoryInformation)!
|
|
286
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, this.accessory.context.FirmwareRevision)
|
|
287
|
+
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
288
|
+
.updateValue(this.accessory.context.FirmwareRevision);
|
|
289
|
+
}
|
|
288
290
|
}
|
|
289
291
|
|
|
290
292
|
/**
|
package/src/device/curtain.ts
CHANGED
|
@@ -464,12 +464,14 @@ export class Curtain extends deviceBase {
|
|
|
464
464
|
+ ` StatusLowBattery: ${this.Battery.StatusLowBattery}`);
|
|
465
465
|
|
|
466
466
|
// FirmwareRevision
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
467
|
+
if (deviceStatus.body.version) {
|
|
468
|
+
this.accessory.context.FirmwareRevision = deviceStatus.body.version;
|
|
469
|
+
this.accessory
|
|
470
|
+
.getService(this.hap.Service.AccessoryInformation)!
|
|
471
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, this.accessory.context.FirmwareRevision)
|
|
472
|
+
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
473
|
+
.updateValue(this.accessory.context.FirmwareRevision);
|
|
474
|
+
}
|
|
473
475
|
}
|
|
474
476
|
|
|
475
477
|
async refreshStatus(): Promise<void> {
|
package/src/device/device.ts
CHANGED
|
@@ -559,8 +559,6 @@ export abstract class deviceBase {
|
|
|
559
559
|
async statusCode(statusCode: number): Promise<void> {
|
|
560
560
|
switch (this.device.deviceType) {
|
|
561
561
|
case this.device.hubDeviceId:
|
|
562
|
-
statusCode = 161;
|
|
563
|
-
break;
|
|
564
562
|
case '000000000000':
|
|
565
563
|
statusCode = 161;
|
|
566
564
|
break;
|
package/src/device/fan.ts
CHANGED
|
@@ -119,12 +119,14 @@ export class Fan extends deviceBase {
|
|
|
119
119
|
this.Battery.BatteryLevel = battery;
|
|
120
120
|
|
|
121
121
|
// FirmwareRevision
|
|
122
|
-
|
|
122
|
+
if (version) {
|
|
123
|
+
this.accessory.context.FirmwareRevision = version;
|
|
123
124
|
this.accessory
|
|
124
125
|
.getService(this.hap.Service.AccessoryInformation)!
|
|
125
126
|
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, this.accessory.context.FirmwareRevision)
|
|
126
127
|
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
127
128
|
.updateValue(this.accessory.context.FirmwareRevision);
|
|
129
|
+
}
|
|
128
130
|
this.updateHomeKitCharacteristics();
|
|
129
131
|
} catch (e: any) {
|
|
130
132
|
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
@@ -202,12 +204,14 @@ export class Fan extends deviceBase {
|
|
|
202
204
|
+ ` StatusLowBattery: ${this.Battery.StatusLowBattery}`);
|
|
203
205
|
|
|
204
206
|
// FirmwareRevision
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
207
|
+
if (deviceStatus.body.version) {
|
|
208
|
+
this.accessory.context.FirmwareRevision = deviceStatus.body.version;
|
|
209
|
+
this.accessory
|
|
210
|
+
.getService(this.hap.Service.AccessoryInformation)!
|
|
211
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, this.accessory.context.FirmwareRevision)
|
|
212
|
+
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
213
|
+
.updateValue(this.accessory.context.FirmwareRevision);
|
|
214
|
+
}
|
|
211
215
|
}
|
|
212
216
|
|
|
213
217
|
|
|
@@ -475,7 +479,7 @@ export class Fan extends deviceBase {
|
|
|
475
479
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} updateCharacteristic Active: ${this.Fan.Active}`);
|
|
476
480
|
}
|
|
477
481
|
// RotationSpeed
|
|
478
|
-
if(this.Fan.RotationSpeed === undefined) {
|
|
482
|
+
if (this.Fan.RotationSpeed === undefined) {
|
|
479
483
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} RotationSpeed: ${this.Fan.RotationSpeed}`);
|
|
480
484
|
} else {
|
|
481
485
|
this.accessory.context.RotationSpeed = this.Fan.RotationSpeed;
|
|
@@ -483,7 +487,7 @@ export class Fan extends deviceBase {
|
|
|
483
487
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} updateCharacteristic RotationSpeed: ${this.Fan.RotationSpeed}`);
|
|
484
488
|
}
|
|
485
489
|
// SwingMode
|
|
486
|
-
if(this.Fan.SwingMode === undefined) {
|
|
490
|
+
if (this.Fan.SwingMode === undefined) {
|
|
487
491
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} SwingMode: ${this.Fan.SwingMode}`);
|
|
488
492
|
} else {
|
|
489
493
|
this.accessory.context.SwingMode = this.Fan.SwingMode;
|
|
@@ -491,7 +495,7 @@ export class Fan extends deviceBase {
|
|
|
491
495
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} updateCharacteristic SwingMode: ${this.Fan.SwingMode}`);
|
|
492
496
|
}
|
|
493
497
|
// BateryLevel
|
|
494
|
-
if(this.Battery.BatteryLevel === undefined) {
|
|
498
|
+
if (this.Battery.BatteryLevel === undefined) {
|
|
495
499
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} BatteryLevel: ${this.Battery.BatteryLevel}`);
|
|
496
500
|
} else {
|
|
497
501
|
this.accessory.context.BatteryLevel = this.Battery.BatteryLevel;
|
|
@@ -499,7 +503,7 @@ export class Fan extends deviceBase {
|
|
|
499
503
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} updateCharacteristic BatteryLevel: ${this.Battery.BatteryLevel}`);
|
|
500
504
|
}
|
|
501
505
|
// ChargingState
|
|
502
|
-
if(this.Battery.ChargingState === undefined) {
|
|
506
|
+
if (this.Battery.ChargingState === undefined) {
|
|
503
507
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} ChargingState: ${this.Battery.ChargingState}`);
|
|
504
508
|
} else {
|
|
505
509
|
this.accessory.context.ChargingState = this.Battery.ChargingState;
|
|
@@ -507,7 +511,7 @@ export class Fan extends deviceBase {
|
|
|
507
511
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} updateCharacteristic ChargingState: ${this.Battery.ChargingState}`);
|
|
508
512
|
}
|
|
509
513
|
// StatusLowBattery
|
|
510
|
-
if(this.Battery.StatusLowBattery === undefined) {
|
|
514
|
+
if (this.Battery.StatusLowBattery === undefined) {
|
|
511
515
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} StatusLowBattery: ${this.Battery.StatusLowBattery}`);
|
|
512
516
|
} else {
|
|
513
517
|
this.accessory.context.StatusLowBattery = this.Battery.StatusLowBattery;
|
package/src/device/hub.ts
CHANGED
|
@@ -157,12 +157,12 @@ export class Hub extends deviceBase {
|
|
|
157
157
|
const { CurrentRelativeHumidity } = this.HumiditySensor || { CurrentRelativeHumidity: undefined };
|
|
158
158
|
if (context.scale !== 'CELCIUS' && device.hub?.convertUnitTo === undefined) {
|
|
159
159
|
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} received a non-CELCIUS Webhook scale: `
|
|
160
|
-
|
|
160
|
+
+ `${context.scale}, Use the *convertUnitsTo* config under Hub settings, if displaying incorrectly in HomeKit.`);
|
|
161
161
|
}
|
|
162
162
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} ` +
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
163
|
+
'(scale, temperature, humidity, lightLevel) = ' +
|
|
164
|
+
`Webhook:(${context.scale}, ${convertUnits(temperature, context.scale, device.hub?.convertUnitTo)}, ${humidity}, ${lightLevel}), ` +
|
|
165
|
+
`current:(${CurrentTemperature}, ${CurrentRelativeHumidity}, ${CurrentAmbientLightLevel})`);
|
|
166
166
|
if (!this.device.hub?.hide_humidity) {
|
|
167
167
|
this.HumiditySensor!.CurrentRelativeHumidity = humidity;
|
|
168
168
|
}
|
|
@@ -217,12 +217,14 @@ export class Hub extends deviceBase {
|
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
// FirmwareRevision
|
|
220
|
-
|
|
220
|
+
if (deviceStatus.body.version) {
|
|
221
|
+
this.accessory.context.FirmwareRevision = deviceStatus.body.version;
|
|
221
222
|
this.accessory
|
|
222
223
|
.getService(this.hap.Service.AccessoryInformation)!
|
|
223
224
|
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, this.accessory.context.FirmwareRevision)
|
|
224
225
|
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
225
226
|
.updateValue(this.accessory.context.FirmwareRevision);
|
|
227
|
+
}
|
|
226
228
|
}
|
|
227
229
|
|
|
228
230
|
async refreshStatus(): Promise<void> {
|
|
@@ -278,7 +280,7 @@ export class Hub extends deviceBase {
|
|
|
278
280
|
if (!this.device.hub?.hide_humidity) {
|
|
279
281
|
if (this.HumiditySensor!.CurrentRelativeHumidity === undefined) {
|
|
280
282
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName}`
|
|
281
|
-
|
|
283
|
+
+ ` CurrentRelativeHumidity: ${this.HumiditySensor!.CurrentRelativeHumidity}`);
|
|
282
284
|
} else {
|
|
283
285
|
if (this.device.mqttURL) {
|
|
284
286
|
mqttmessage.push(`"humidity": ${this.HumiditySensor!.CurrentRelativeHumidity}`);
|
|
@@ -308,7 +310,7 @@ export class Hub extends deviceBase {
|
|
|
308
310
|
this.accessory.context.CurrentTemperature = this.TemperatureSensor!.CurrentTemperature;
|
|
309
311
|
this.TemperatureSensor!.Service.updateCharacteristic(this.hap.Characteristic.CurrentTemperature, this.TemperatureSensor!.CurrentTemperature);
|
|
310
312
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} updateCharacteristic`
|
|
311
|
-
|
|
313
|
+
+ ` CurrentTemperature: ${this.TemperatureSensor!.CurrentTemperature}`);
|
|
312
314
|
}
|
|
313
315
|
}
|
|
314
316
|
|
|
@@ -316,7 +318,7 @@ export class Hub extends deviceBase {
|
|
|
316
318
|
if (!this.device.hub?.hide_lightsensor) {
|
|
317
319
|
if (this.LightSensor!.CurrentAmbientLightLevel === undefined) {
|
|
318
320
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName}`
|
|
319
|
-
|
|
321
|
+
+ ` CurrentAmbientLightLevel: ${this.LightSensor!.CurrentAmbientLightLevel}`);
|
|
320
322
|
} else {
|
|
321
323
|
if (this.device.mqttURL) {
|
|
322
324
|
mqttmessage.push(`"light": ${this.LightSensor!.CurrentAmbientLightLevel}`);
|
package/src/device/humidifier.ts
CHANGED
|
@@ -269,12 +269,14 @@ export class Humidifier extends deviceBase {
|
|
|
269
269
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} WaterLevel: ${this.HumidifierDehumidifier.WaterLevel}`);
|
|
270
270
|
|
|
271
271
|
// FirmwareRevision
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
272
|
+
if (deviceStatus.body.version) {
|
|
273
|
+
this.accessory.context.FirmwareRevision = deviceStatus.body.version;
|
|
274
|
+
this.accessory
|
|
275
|
+
.getService(this.hap.Service.AccessoryInformation)!
|
|
276
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, this.accessory.context.FirmwareRevision)
|
|
277
|
+
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
278
|
+
.updateValue(this.accessory.context.FirmwareRevision);
|
|
279
|
+
}
|
|
278
280
|
}
|
|
279
281
|
|
|
280
282
|
async refreshStatus(): Promise<void> {
|
package/src/device/iosensor.ts
CHANGED
|
@@ -228,12 +228,14 @@ export class IOSensor extends deviceBase {
|
|
|
228
228
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Temperature: ${this.TemperatureSensor!.CurrentTemperature}°c`);
|
|
229
229
|
}
|
|
230
230
|
// FirmwareRevision
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
231
|
+
if (deviceStatus.body.version) {
|
|
232
|
+
this.accessory.context.FirmwareRevision = deviceStatus.body.version;
|
|
233
|
+
this.accessory
|
|
234
|
+
.getService(this.hap.Service.AccessoryInformation)!
|
|
235
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, this.accessory.context.FirmwareRevision)
|
|
236
|
+
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
237
|
+
.updateValue(this.accessory.context.FirmwareRevision);
|
|
238
|
+
}
|
|
237
239
|
}
|
|
238
240
|
|
|
239
241
|
/**
|
package/src/device/lightstrip.ts
CHANGED
|
@@ -326,12 +326,14 @@ export class StripLight extends deviceBase {
|
|
|
326
326
|
}
|
|
327
327
|
|
|
328
328
|
// FirmwareRevision
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
329
|
+
if (deviceStatus.body.version) {
|
|
330
|
+
this.accessory.context.FirmwareRevision = deviceStatus.body.version;
|
|
331
|
+
this.accessory
|
|
332
|
+
.getService(this.hap.Service.AccessoryInformation)!
|
|
333
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, this.accessory.context.FirmwareRevision)
|
|
334
|
+
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
335
|
+
.updateValue(this.accessory.context.FirmwareRevision);
|
|
336
|
+
}
|
|
335
337
|
}
|
|
336
338
|
|
|
337
339
|
/**
|
package/src/device/lock.ts
CHANGED
|
@@ -256,12 +256,14 @@ export class Lock extends deviceBase {
|
|
|
256
256
|
+ ` StatusLowBattery: ${this.Battery.StatusLowBattery}`);
|
|
257
257
|
|
|
258
258
|
// FirmwareRevision
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
259
|
+
if (deviceStatus.body.version) {
|
|
260
|
+
this.accessory.context.FirmwareRevision = deviceStatus.body.version;
|
|
261
|
+
this.accessory
|
|
262
|
+
.getService(this.hap.Service.AccessoryInformation)!
|
|
263
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, this.accessory.context.FirmwareRevision)
|
|
264
|
+
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
265
|
+
.updateValue(this.accessory.context.FirmwareRevision);
|
|
266
|
+
}
|
|
265
267
|
}
|
|
266
268
|
|
|
267
269
|
/**
|
package/src/device/meter.ts
CHANGED
|
@@ -224,12 +224,14 @@ export class Meter extends deviceBase {
|
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
// FirmwareRevision
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
227
|
+
if (deviceStatus.body.version) {
|
|
228
|
+
this.accessory.context.FirmwareRevision = deviceStatus.body.version;
|
|
229
|
+
this.accessory
|
|
230
|
+
.getService(this.hap.Service.AccessoryInformation)!
|
|
231
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, this.accessory.context.FirmwareRevision)
|
|
232
|
+
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
233
|
+
.updateValue(this.accessory.context.FirmwareRevision);
|
|
234
|
+
}
|
|
233
235
|
}
|
|
234
236
|
|
|
235
237
|
/**
|
package/src/device/meterplus.ts
CHANGED
|
@@ -225,12 +225,14 @@ export class MeterPlus extends deviceBase {
|
|
|
225
225
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Temperature: ${this.TemperatureSensor!.CurrentTemperature}°c`);
|
|
226
226
|
}
|
|
227
227
|
// FirmwareRevision
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
228
|
+
if (deviceStatus.body.version) {
|
|
229
|
+
this.accessory.context.FirmwareRevision = deviceStatus.body.version;
|
|
230
|
+
this.accessory
|
|
231
|
+
.getService(this.hap.Service.AccessoryInformation)!
|
|
232
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, this.accessory.context.FirmwareRevision)
|
|
233
|
+
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
234
|
+
.updateValue(this.accessory.context.FirmwareRevision);
|
|
235
|
+
}
|
|
234
236
|
}
|
|
235
237
|
|
|
236
238
|
/**
|
package/src/device/motion.ts
CHANGED
|
@@ -200,12 +200,14 @@ export class Motion extends deviceBase {
|
|
|
200
200
|
+ ` StatusLowBattery: ${this.Battery.StatusLowBattery}`);
|
|
201
201
|
|
|
202
202
|
// FirmwareRevision
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
203
|
+
if (deviceStatus.body.version) {
|
|
204
|
+
this.accessory.context.FirmwareRevision = deviceStatus.body.version;
|
|
205
|
+
this.accessory
|
|
206
|
+
.getService(this.hap.Service.AccessoryInformation)!
|
|
207
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, this.accessory.context.FirmwareRevision)
|
|
208
|
+
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
209
|
+
.updateValue(this.accessory.context.FirmwareRevision);
|
|
210
|
+
}
|
|
209
211
|
}
|
|
210
212
|
|
|
211
213
|
/**
|
package/src/device/plug.ts
CHANGED
|
@@ -130,12 +130,14 @@ export class Plug extends deviceBase {
|
|
|
130
130
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} On: ${this.Outlet.On}`);
|
|
131
131
|
|
|
132
132
|
// FirmwareRevision
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
133
|
+
if (deviceStatus.body.version) {
|
|
134
|
+
this.accessory.context.FirmwareRevision = deviceStatus.body.version;
|
|
135
|
+
this.accessory
|
|
136
|
+
.getService(this.hap.Service.AccessoryInformation)!
|
|
137
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, this.accessory.context.FirmwareRevision)
|
|
138
|
+
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
139
|
+
.updateValue(this.accessory.context.FirmwareRevision);
|
|
140
|
+
}
|
|
139
141
|
}
|
|
140
142
|
|
|
141
143
|
/**
|
|
@@ -199,12 +199,14 @@ export class RobotVacuumCleaner extends deviceBase {
|
|
|
199
199
|
+ ` StatusLowBattery: ${this.Battery.StatusLowBattery}`);
|
|
200
200
|
|
|
201
201
|
// FirmwareRevision
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
202
|
+
if (deviceStatus.body.version) {
|
|
203
|
+
this.accessory.context.FirmwareRevision = deviceStatus.body.version;
|
|
204
|
+
this.accessory
|
|
205
|
+
.getService(this.hap.Service.AccessoryInformation)!
|
|
206
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, this.accessory.context.FirmwareRevision)
|
|
207
|
+
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
208
|
+
.updateValue(this.accessory.context.FirmwareRevision);
|
|
209
|
+
}
|
|
208
210
|
}
|
|
209
211
|
|
|
210
212
|
/**
|
|
@@ -166,12 +166,14 @@ export class WaterDetector extends deviceBase {
|
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
// FirmwareRevision
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
169
|
+
if (deviceStatus.body.version) {
|
|
170
|
+
this.accessory.context.FirmwareRevision = deviceStatus.body.version;
|
|
171
|
+
this.accessory
|
|
172
|
+
.getService(this.hap.Service.AccessoryInformation)!
|
|
173
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, this.accessory.context.FirmwareRevision)
|
|
174
|
+
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
175
|
+
.updateValue(this.accessory.context.FirmwareRevision);
|
|
176
|
+
}
|
|
175
177
|
}
|
|
176
178
|
|
|
177
179
|
async refreshStatus(): Promise<void> {
|