@switchbot/homebridge-switchbot 2.9.0-beta.0 → 2.9.0-beta.10
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 +27 -15
- package/dist/device/blindtilt.js +2 -2
- package/dist/device/blindtilt.js.map +1 -1
- package/dist/device/bot.d.ts.map +1 -1
- package/dist/device/bot.js +10 -4
- package/dist/device/bot.js.map +1 -1
- package/dist/device/ceilinglight.js +2 -2
- package/dist/device/ceilinglight.js.map +1 -1
- package/dist/device/colorbulb.d.ts.map +1 -1
- package/dist/device/colorbulb.js +7 -4
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/device/contact.js +2 -2
- package/dist/device/contact.js.map +1 -1
- package/dist/device/curtain.js +2 -2
- package/dist/device/curtain.js.map +1 -1
- package/dist/device/hub.js +2 -2
- package/dist/device/hub.js.map +1 -1
- package/dist/device/humidifier.js +2 -2
- package/dist/device/humidifier.js.map +1 -1
- package/dist/device/iosensor.js +2 -2
- package/dist/device/iosensor.js.map +1 -1
- package/dist/device/lightstrip.js +2 -2
- package/dist/device/lightstrip.js.map +1 -1
- package/dist/device/lock.js +2 -2
- package/dist/device/lock.js.map +1 -1
- package/dist/device/meter.js +2 -2
- package/dist/device/meter.js.map +1 -1
- package/dist/device/meterplus.js +2 -2
- package/dist/device/meterplus.js.map +1 -1
- package/dist/device/motion.js +2 -2
- package/dist/device/motion.js.map +1 -1
- package/dist/device/plug.js +2 -2
- package/dist/device/plug.js.map +1 -1
- package/dist/device/robotvacuumcleaner.d.ts.map +1 -1
- package/dist/device/robotvacuumcleaner.js +8 -5
- package/dist/device/robotvacuumcleaner.js.map +1 -1
- package/dist/irdevice/airconditioner.js +5 -5
- package/dist/irdevice/airconditioner.js.map +1 -1
- package/dist/irdevice/airpurifier.js +5 -5
- package/dist/irdevice/airpurifier.js.map +1 -1
- package/dist/irdevice/camera.js +5 -5
- package/dist/irdevice/camera.js.map +1 -1
- package/dist/irdevice/fan.js +5 -5
- package/dist/irdevice/fan.js.map +1 -1
- package/dist/irdevice/light.js +5 -5
- package/dist/irdevice/light.js.map +1 -1
- package/dist/irdevice/other.d.ts.map +1 -1
- package/dist/irdevice/other.js +27 -12
- package/dist/irdevice/other.js.map +1 -1
- package/dist/irdevice/tv.js +5 -5
- package/dist/irdevice/tv.js.map +1 -1
- package/dist/irdevice/vacuumcleaner.js +5 -5
- package/dist/irdevice/vacuumcleaner.js.map +1 -1
- package/dist/irdevice/waterheater.js +5 -5
- package/dist/irdevice/waterheater.js.map +1 -1
- package/dist/settings.d.ts +1 -0
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js.map +1 -1
- package/package.json +1 -1
- package/src/device/blindtilt.ts +2 -2
- package/src/device/bot.ts +9 -4
- package/src/device/ceilinglight.ts +2 -2
- package/src/device/colorbulb.ts +7 -4
- package/src/device/contact.ts +2 -2
- package/src/device/curtain.ts +2 -2
- package/src/device/hub.ts +2 -2
- package/src/device/humidifier.ts +2 -2
- package/src/device/iosensor.ts +2 -2
- package/src/device/lightstrip.ts +2 -2
- package/src/device/lock.ts +2 -2
- package/src/device/meter.ts +2 -2
- package/src/device/meterplus.ts +2 -2
- package/src/device/motion.ts +2 -2
- package/src/device/plug.ts +2 -2
- package/src/device/robotvacuumcleaner.ts +6 -4
- package/src/irdevice/airconditioner.ts +5 -5
- package/src/irdevice/airpurifier.ts +5 -5
- package/src/irdevice/camera.ts +5 -5
- package/src/irdevice/fan.ts +5 -5
- package/src/irdevice/light.ts +5 -5
- package/src/irdevice/other.ts +25 -12
- package/src/irdevice/tv.ts +5 -5
- package/src/irdevice/vacuumcleaner.ts +5 -5
- package/src/irdevice/waterheater.ts +5 -5
- package/src/settings.ts +1 -0
package/src/device/curtain.ts
CHANGED
|
@@ -471,7 +471,7 @@ export class Curtain {
|
|
|
471
471
|
+ ` StatusLowBattery: ${this.StatusLowBattery}`);
|
|
472
472
|
|
|
473
473
|
// FirmwareRevision
|
|
474
|
-
this.FirmwareRevision =
|
|
474
|
+
this.FirmwareRevision = this.OpenAPI_FirmwareRevision!;
|
|
475
475
|
}
|
|
476
476
|
|
|
477
477
|
async refreshStatus(): Promise<void> {
|
|
@@ -1118,7 +1118,7 @@ export class Curtain {
|
|
|
1118
1118
|
if (device.firmware) {
|
|
1119
1119
|
this.FirmwareRevision = device.firmware;
|
|
1120
1120
|
} else if (device.version) {
|
|
1121
|
-
this.FirmwareRevision =
|
|
1121
|
+
this.FirmwareRevision = device.version;
|
|
1122
1122
|
} if (accessory.context.FirmwareRevision) {
|
|
1123
1123
|
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
1124
1124
|
} else {
|
package/src/device/hub.ts
CHANGED
|
@@ -278,7 +278,7 @@ export class Hub {
|
|
|
278
278
|
}
|
|
279
279
|
|
|
280
280
|
// FirmwareRevision
|
|
281
|
-
this.FirmwareRevision =
|
|
281
|
+
this.FirmwareRevision = this.OpenAPI_FirmwareRevision!;
|
|
282
282
|
}
|
|
283
283
|
|
|
284
284
|
async refreshStatus(): Promise<void> {
|
|
@@ -483,7 +483,7 @@ export class Hub {
|
|
|
483
483
|
if (device.firmware) {
|
|
484
484
|
this.FirmwareRevision = device.firmware;
|
|
485
485
|
} else if (device.version) {
|
|
486
|
-
this.FirmwareRevision =
|
|
486
|
+
this.FirmwareRevision = device.version;
|
|
487
487
|
} else if (accessory.context.FirmwareRevision) {
|
|
488
488
|
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
489
489
|
} else {
|
package/src/device/humidifier.ts
CHANGED
|
@@ -283,7 +283,7 @@ export class Humidifier {
|
|
|
283
283
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} WaterLevel: ${this.WaterLevel}`);
|
|
284
284
|
|
|
285
285
|
// FirmwareRevision
|
|
286
|
-
this.FirmwareRevision =
|
|
286
|
+
this.FirmwareRevision = this.OpenAPI_FirmwareRevision!;
|
|
287
287
|
}
|
|
288
288
|
|
|
289
289
|
/**
|
|
@@ -893,7 +893,7 @@ export class Humidifier {
|
|
|
893
893
|
if (device.firmware) {
|
|
894
894
|
this.FirmwareRevision = device.firmware;
|
|
895
895
|
} else if (device.version) {
|
|
896
|
-
this.FirmwareRevision =
|
|
896
|
+
this.FirmwareRevision = device.version;
|
|
897
897
|
} else if (accessory.context.FirmwareRevision) {
|
|
898
898
|
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
899
899
|
} else {
|
package/src/device/iosensor.ts
CHANGED
|
@@ -254,7 +254,7 @@ export class IOSensor {
|
|
|
254
254
|
+ ` StatusLowBattery: ${this.StatusLowBattery}`);
|
|
255
255
|
|
|
256
256
|
// FirmwareRevision
|
|
257
|
-
this.FirmwareRevision =
|
|
257
|
+
this.FirmwareRevision = this.OpenAPI_FirmwareRevision!;
|
|
258
258
|
}
|
|
259
259
|
|
|
260
260
|
/**
|
|
@@ -629,7 +629,7 @@ export class IOSensor {
|
|
|
629
629
|
if (device.firmware) {
|
|
630
630
|
this.FirmwareRevision = device.firmware;
|
|
631
631
|
} else if (device.version) {
|
|
632
|
-
this.FirmwareRevision =
|
|
632
|
+
this.FirmwareRevision = device.version;
|
|
633
633
|
} else if (accessory.context.FirmwareRevision) {
|
|
634
634
|
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
635
635
|
} else {
|
package/src/device/lightstrip.ts
CHANGED
|
@@ -278,7 +278,7 @@ export class StripLight {
|
|
|
278
278
|
}
|
|
279
279
|
|
|
280
280
|
// FirmwareRevision
|
|
281
|
-
this.FirmwareRevision =
|
|
281
|
+
this.FirmwareRevision = this.OpenAPI_FirmwareRevision!;
|
|
282
282
|
}
|
|
283
283
|
|
|
284
284
|
/**
|
|
@@ -1034,7 +1034,7 @@ export class StripLight {
|
|
|
1034
1034
|
if (device.firmware) {
|
|
1035
1035
|
this.FirmwareRevision = device.firmware;
|
|
1036
1036
|
} else if (device.version) {
|
|
1037
|
-
this.FirmwareRevision =
|
|
1037
|
+
this.FirmwareRevision = device.version;
|
|
1038
1038
|
} else if (accessory.context.FirmwareRevision) {
|
|
1039
1039
|
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
1040
1040
|
} else {
|
package/src/device/lock.ts
CHANGED
|
@@ -240,7 +240,7 @@ export class Lock {
|
|
|
240
240
|
+ ` StatusLowBattery: ${this.StatusLowBattery}`);
|
|
241
241
|
|
|
242
242
|
// FirmwareRevision
|
|
243
|
-
this.FirmwareRevision =
|
|
243
|
+
this.FirmwareRevision = this.OpenAPI_FirmwareRevision!;
|
|
244
244
|
}
|
|
245
245
|
|
|
246
246
|
/**
|
|
@@ -669,7 +669,7 @@ export class Lock {
|
|
|
669
669
|
if (device.firmware) {
|
|
670
670
|
this.FirmwareRevision = device.firmware;
|
|
671
671
|
} else if (device.version) {
|
|
672
|
-
this.FirmwareRevision =
|
|
672
|
+
this.FirmwareRevision = device.version;
|
|
673
673
|
} else if (accessory.context.FirmwareRevision) {
|
|
674
674
|
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
675
675
|
} else {
|
package/src/device/meter.ts
CHANGED
|
@@ -255,7 +255,7 @@ export class Meter {
|
|
|
255
255
|
+ ` StatusLowBattery: ${this.StatusLowBattery}`);
|
|
256
256
|
|
|
257
257
|
// FirmwareRevision
|
|
258
|
-
this.FirmwareRevision =
|
|
258
|
+
this.FirmwareRevision = this.OpenAPI_FirmwareRevision!;
|
|
259
259
|
}
|
|
260
260
|
|
|
261
261
|
/**
|
|
@@ -637,7 +637,7 @@ export class Meter {
|
|
|
637
637
|
if (device.firmware) {
|
|
638
638
|
this.FirmwareRevision = device.firmware;
|
|
639
639
|
} else if (device.version) {
|
|
640
|
-
this.FirmwareRevision =
|
|
640
|
+
this.FirmwareRevision = device.version;
|
|
641
641
|
} else if (accessory.context.FirmwareRevision) {
|
|
642
642
|
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
643
643
|
} else {
|
package/src/device/meterplus.ts
CHANGED
|
@@ -255,7 +255,7 @@ export class MeterPlus {
|
|
|
255
255
|
+ ` StatusLowBattery: ${this.StatusLowBattery}`);
|
|
256
256
|
|
|
257
257
|
// FirmwareRevision
|
|
258
|
-
this.FirmwareRevision =
|
|
258
|
+
this.FirmwareRevision = this.OpenAPI_FirmwareRevision!;
|
|
259
259
|
}
|
|
260
260
|
|
|
261
261
|
/**
|
|
@@ -648,7 +648,7 @@ export class MeterPlus {
|
|
|
648
648
|
if (device.firmware) {
|
|
649
649
|
this.FirmwareRevision = device.firmware;
|
|
650
650
|
} else if (device.version) {
|
|
651
|
-
this.FirmwareRevision =
|
|
651
|
+
this.FirmwareRevision = device.version;
|
|
652
652
|
} else if (accessory.context.FirmwareRevision) {
|
|
653
653
|
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
654
654
|
} else {
|
package/src/device/motion.ts
CHANGED
|
@@ -229,7 +229,7 @@ export class Motion {
|
|
|
229
229
|
+ ` StatusLowBattery: ${this.StatusLowBattery}`);
|
|
230
230
|
|
|
231
231
|
// FirmwareRevision
|
|
232
|
-
this.FirmwareRevision =
|
|
232
|
+
this.FirmwareRevision = this.OpenAPI_FirmwareRevision!;
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
/**
|
|
@@ -571,7 +571,7 @@ export class Motion {
|
|
|
571
571
|
if (device.firmware) {
|
|
572
572
|
this.FirmwareRevision = device.firmware;
|
|
573
573
|
} else if (device.version) {
|
|
574
|
-
this.FirmwareRevision =
|
|
574
|
+
this.FirmwareRevision = device.version;
|
|
575
575
|
} else if (accessory.context.FirmwareRevision) {
|
|
576
576
|
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
577
577
|
} else {
|
package/src/device/plug.ts
CHANGED
|
@@ -156,7 +156,7 @@ export class Plug {
|
|
|
156
156
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} On: ${this.On}`);
|
|
157
157
|
|
|
158
158
|
// FirmwareRevision
|
|
159
|
-
this.FirmwareRevision =
|
|
159
|
+
this.FirmwareRevision = this.OpenAPI_FirmwareRevision!;
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
/**
|
|
@@ -597,7 +597,7 @@ export class Plug {
|
|
|
597
597
|
if (device.firmware) {
|
|
598
598
|
this.FirmwareRevision = device.firmware;
|
|
599
599
|
} else if (device.version) {
|
|
600
|
-
this.FirmwareRevision =
|
|
600
|
+
this.FirmwareRevision = device.version;
|
|
601
601
|
} else if (accessory.context.FirmwareRevision) {
|
|
602
602
|
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
603
603
|
} else {
|
|
@@ -202,7 +202,7 @@ export class RobotVacuumCleaner {
|
|
|
202
202
|
this.debugLog(`${this.accessory.displayName} BatteryLevel: ${this.BatteryLevel}, StatusLowBattery: ${this.StatusLowBattery}`);
|
|
203
203
|
|
|
204
204
|
// FirmwareRevision
|
|
205
|
-
this.FirmwareRevision =
|
|
205
|
+
this.FirmwareRevision = this.OpenAPI_FirmwareRevision!;
|
|
206
206
|
}
|
|
207
207
|
|
|
208
208
|
/**
|
|
@@ -757,10 +757,12 @@ export class RobotVacuumCleaner {
|
|
|
757
757
|
);
|
|
758
758
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
759
759
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
760
|
-
if (
|
|
761
|
-
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
762
|
-
} else if (device.firmware) {
|
|
760
|
+
if (device.firmware) {
|
|
763
761
|
this.FirmwareRevision = device.firmware;
|
|
762
|
+
} else if (device.version) {
|
|
763
|
+
this.FirmwareRevision = device.version;
|
|
764
|
+
} else if (accessory.context.FirmwareRevision) {
|
|
765
|
+
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
764
766
|
} else {
|
|
765
767
|
this.FirmwareRevision = this.platform.version;
|
|
766
768
|
}
|
|
@@ -637,15 +637,15 @@ export class AirConditioner {
|
|
|
637
637
|
);
|
|
638
638
|
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
639
639
|
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
640
|
-
if (
|
|
641
|
-
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
642
|
-
} else if (device.firmware) {
|
|
640
|
+
if (device.firmware) {
|
|
643
641
|
this.FirmwareRevision = device.firmware;
|
|
642
|
+
} else if (accessory.context.FirmwareRevision) {
|
|
643
|
+
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
644
644
|
} else {
|
|
645
|
-
this.FirmwareRevision = this.platform.version
|
|
645
|
+
this.FirmwareRevision = this.platform.version;
|
|
646
646
|
}
|
|
647
647
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} setFirmwareRevision: ${this.FirmwareRevision}`);
|
|
648
|
-
return
|
|
648
|
+
return String(this.FirmwareRevision);
|
|
649
649
|
}
|
|
650
650
|
|
|
651
651
|
async context(): Promise<void> {
|
|
@@ -384,15 +384,15 @@ export class AirPurifier {
|
|
|
384
384
|
);
|
|
385
385
|
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
386
386
|
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
387
|
-
if (
|
|
388
|
-
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
389
|
-
} else if (device.firmware) {
|
|
387
|
+
if (device.firmware) {
|
|
390
388
|
this.FirmwareRevision = device.firmware;
|
|
389
|
+
} else if (accessory.context.FirmwareRevision) {
|
|
390
|
+
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
391
391
|
} else {
|
|
392
|
-
this.FirmwareRevision = this.platform.version
|
|
392
|
+
this.FirmwareRevision = this.platform.version;
|
|
393
393
|
}
|
|
394
394
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} setFirmwareRevision: ${this.FirmwareRevision}`);
|
|
395
|
-
return
|
|
395
|
+
return String(this.FirmwareRevision);
|
|
396
396
|
}
|
|
397
397
|
|
|
398
398
|
private context() {
|
package/src/irdevice/camera.ts
CHANGED
|
@@ -265,15 +265,15 @@ export class Camera {
|
|
|
265
265
|
);
|
|
266
266
|
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
267
267
|
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
268
|
-
if (
|
|
269
|
-
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
270
|
-
} else if (device.firmware) {
|
|
268
|
+
if (device.firmware) {
|
|
271
269
|
this.FirmwareRevision = device.firmware;
|
|
270
|
+
} else if (accessory.context.FirmwareRevision) {
|
|
271
|
+
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
272
272
|
} else {
|
|
273
|
-
this.FirmwareRevision = this.platform.version
|
|
273
|
+
this.FirmwareRevision = this.platform.version;
|
|
274
274
|
}
|
|
275
275
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} setFirmwareRevision: ${this.FirmwareRevision}`);
|
|
276
|
-
return
|
|
276
|
+
return String(this.FirmwareRevision);
|
|
277
277
|
}
|
|
278
278
|
|
|
279
279
|
async context() {
|
package/src/irdevice/fan.ts
CHANGED
|
@@ -397,15 +397,15 @@ export class Fan {
|
|
|
397
397
|
);
|
|
398
398
|
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
399
399
|
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
400
|
-
if (
|
|
401
|
-
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
402
|
-
} else if (device.firmware) {
|
|
400
|
+
if (device.firmware) {
|
|
403
401
|
this.FirmwareRevision = device.firmware;
|
|
402
|
+
} else if (accessory.context.FirmwareRevision) {
|
|
403
|
+
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
404
404
|
} else {
|
|
405
|
-
this.FirmwareRevision = this.platform.version
|
|
405
|
+
this.FirmwareRevision = this.platform.version;
|
|
406
406
|
}
|
|
407
407
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} setFirmwareRevision: ${this.FirmwareRevision}`);
|
|
408
|
-
return
|
|
408
|
+
return String(this.FirmwareRevision);
|
|
409
409
|
}
|
|
410
410
|
|
|
411
411
|
async context() {
|
package/src/irdevice/light.ts
CHANGED
|
@@ -290,15 +290,15 @@ export class Light {
|
|
|
290
290
|
);
|
|
291
291
|
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
292
292
|
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
293
|
-
if (
|
|
294
|
-
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
295
|
-
} else if (device.firmware) {
|
|
293
|
+
if (device.firmware) {
|
|
296
294
|
this.FirmwareRevision = device.firmware;
|
|
295
|
+
} else if (accessory.context.FirmwareRevision) {
|
|
296
|
+
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
297
297
|
} else {
|
|
298
|
-
this.FirmwareRevision = this.platform.version
|
|
298
|
+
this.FirmwareRevision = this.platform.version;
|
|
299
299
|
}
|
|
300
300
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} setFirmwareRevision: ${this.FirmwareRevision}`);
|
|
301
|
-
return
|
|
301
|
+
return String(this.FirmwareRevision);
|
|
302
302
|
}
|
|
303
303
|
|
|
304
304
|
async context() {
|
package/src/irdevice/other.ts
CHANGED
|
@@ -349,6 +349,13 @@ export class Others {
|
|
|
349
349
|
this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Set On: ${value}`);
|
|
350
350
|
this.On = value;
|
|
351
351
|
}
|
|
352
|
+
|
|
353
|
+
//pushChanges
|
|
354
|
+
if (this.On) {
|
|
355
|
+
await this.pushOnChanges();
|
|
356
|
+
} else {
|
|
357
|
+
await this.pushOffChanges();
|
|
358
|
+
}
|
|
352
359
|
}
|
|
353
360
|
|
|
354
361
|
/**
|
|
@@ -659,7 +666,9 @@ export class Others {
|
|
|
659
666
|
|
|
660
667
|
async commandType(): Promise<string> {
|
|
661
668
|
let commandType: string;
|
|
662
|
-
if (this.device.customize) {
|
|
669
|
+
if (this.device.commandType && this.device.customize) {
|
|
670
|
+
commandType = this.device.commandType;
|
|
671
|
+
} else if (this.device.customize) {
|
|
663
672
|
commandType = 'customize';
|
|
664
673
|
} else {
|
|
665
674
|
commandType = 'command';
|
|
@@ -852,13 +861,17 @@ export class Others {
|
|
|
852
861
|
}
|
|
853
862
|
|
|
854
863
|
async deviceType(device: irdevice & irDevicesConfig): Promise<void> {
|
|
855
|
-
if (device.other?.deviceType) {
|
|
856
|
-
this.otherDeviceType = this.accessory.context.deviceType
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
864
|
+
if (!device.other?.deviceType && this.accessory.context.deviceType) {
|
|
865
|
+
this.otherDeviceType = this.accessory.context.deviceType;
|
|
866
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Device Type: ${this.otherDeviceType}, from Accesory Cache.`);
|
|
867
|
+
} else if (device.other?.deviceType) {
|
|
868
|
+
this.accessory.context.deviceType = device.other.deviceType;
|
|
869
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} Accesory Cache: ${this.accessory.context.deviceType}`);
|
|
870
|
+
this.otherDeviceType = this.accessory.context.deviceType;
|
|
871
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Device Type: ${this.otherDeviceType}`);
|
|
860
872
|
} else {
|
|
861
|
-
this.
|
|
873
|
+
this.otherDeviceType = 'outlet';
|
|
874
|
+
this.warnLog(`${this.device.remoteType}: ${this.accessory.displayName} no deviceType set, using default deviceType: ${this.otherDeviceType}`);
|
|
862
875
|
}
|
|
863
876
|
}
|
|
864
877
|
|
|
@@ -868,15 +881,15 @@ export class Others {
|
|
|
868
881
|
);
|
|
869
882
|
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
870
883
|
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
871
|
-
if (
|
|
872
|
-
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
873
|
-
} else if (device.firmware) {
|
|
884
|
+
if (device.firmware) {
|
|
874
885
|
this.FirmwareRevision = device.firmware;
|
|
886
|
+
} else if (accessory.context.FirmwareRevision) {
|
|
887
|
+
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
875
888
|
} else {
|
|
876
|
-
this.FirmwareRevision = this.platform.version
|
|
889
|
+
this.FirmwareRevision = this.platform.version;
|
|
877
890
|
}
|
|
878
891
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} setFirmwareRevision: ${this.FirmwareRevision}`);
|
|
879
|
-
return
|
|
892
|
+
return String(this.FirmwareRevision);
|
|
880
893
|
}
|
|
881
894
|
|
|
882
895
|
async context() {
|
package/src/irdevice/tv.ts
CHANGED
|
@@ -531,15 +531,15 @@ export class TV {
|
|
|
531
531
|
);
|
|
532
532
|
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
533
533
|
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
534
|
-
if (
|
|
535
|
-
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
536
|
-
} else if (device.firmware) {
|
|
534
|
+
if (device.firmware) {
|
|
537
535
|
this.FirmwareRevision = device.firmware;
|
|
536
|
+
} else if (accessory.context.FirmwareRevision) {
|
|
537
|
+
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
538
538
|
} else {
|
|
539
|
-
this.FirmwareRevision = this.platform.version
|
|
539
|
+
this.FirmwareRevision = this.platform.version;
|
|
540
540
|
}
|
|
541
541
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} setFirmwareRevision: ${this.FirmwareRevision}`);
|
|
542
|
-
return
|
|
542
|
+
return String(this.FirmwareRevision);
|
|
543
543
|
}
|
|
544
544
|
|
|
545
545
|
async context() {
|
|
@@ -261,15 +261,15 @@ export class VacuumCleaner {
|
|
|
261
261
|
);
|
|
262
262
|
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
263
263
|
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
264
|
-
if (
|
|
265
|
-
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
266
|
-
} else if (device.firmware) {
|
|
264
|
+
if (device.firmware) {
|
|
267
265
|
this.FirmwareRevision = device.firmware;
|
|
266
|
+
} else if (accessory.context.FirmwareRevision) {
|
|
267
|
+
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
268
268
|
} else {
|
|
269
|
-
this.FirmwareRevision = this.platform.version
|
|
269
|
+
this.FirmwareRevision = this.platform.version;
|
|
270
270
|
}
|
|
271
271
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} setFirmwareRevision: ${this.FirmwareRevision}`);
|
|
272
|
-
return
|
|
272
|
+
return String(this.FirmwareRevision);
|
|
273
273
|
}
|
|
274
274
|
|
|
275
275
|
async context() {
|
|
@@ -270,15 +270,15 @@ export class WaterHeater {
|
|
|
270
270
|
);
|
|
271
271
|
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
272
272
|
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
273
|
-
if (
|
|
274
|
-
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
275
|
-
} else if (device.firmware) {
|
|
273
|
+
if (device.firmware) {
|
|
276
274
|
this.FirmwareRevision = device.firmware;
|
|
275
|
+
} else if (accessory.context.FirmwareRevision) {
|
|
276
|
+
this.FirmwareRevision = accessory.context.FirmwareRevision;
|
|
277
277
|
} else {
|
|
278
|
-
this.FirmwareRevision = this.platform.version
|
|
278
|
+
this.FirmwareRevision = this.platform.version;
|
|
279
279
|
}
|
|
280
280
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} setFirmwareRevision: ${this.FirmwareRevision}`);
|
|
281
|
-
return
|
|
281
|
+
return String(this.FirmwareRevision);
|
|
282
282
|
}
|
|
283
283
|
|
|
284
284
|
async context(): Promise<void> {
|
package/src/settings.ts
CHANGED