@switchbot/homebridge-switchbot 2.2.0-beta.2 → 2.2.0-beta.3
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/bot.d.ts +3 -1
- package/dist/device/bot.d.ts.map +1 -1
- package/dist/device/bot.js +3 -3
- package/dist/device/bot.js.map +1 -1
- package/dist/device/colorbulb.js +79 -77
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/device/contact.d.ts +3 -1
- package/dist/device/contact.d.ts.map +1 -1
- package/dist/device/contact.js +3 -3
- 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/humidifier.js +2 -2
- package/dist/device/humidifier.js.map +1 -1
- package/dist/device/lock.d.ts +8 -1
- package/dist/device/lock.d.ts.map +1 -1
- package/dist/device/lock.js +83 -0
- 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.d.ts +3 -1
- package/dist/device/motion.d.ts.map +1 -1
- package/dist/device/motion.js +3 -3
- 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/striplight.js +2 -2
- package/dist/device/striplight.js.map +1 -1
- package/dist/irdevice/airconditioner.d.ts +1 -4
- package/dist/irdevice/airconditioner.d.ts.map +1 -1
- package/dist/irdevice/airconditioner.js +16 -28
- package/dist/irdevice/airconditioner.js.map +1 -1
- package/dist/irdevice/airpurifier.d.ts.map +1 -1
- package/dist/irdevice/airpurifier.js +4 -5
- package/dist/irdevice/airpurifier.js.map +1 -1
- package/dist/irdevice/camera.d.ts.map +1 -1
- package/dist/irdevice/camera.js +2 -3
- package/dist/irdevice/camera.js.map +1 -1
- package/dist/irdevice/fan.d.ts.map +1 -1
- package/dist/irdevice/fan.js +11 -10
- package/dist/irdevice/fan.js.map +1 -1
- package/dist/irdevice/light.d.ts.map +1 -1
- package/dist/irdevice/light.js +2 -3
- package/dist/irdevice/light.js.map +1 -1
- package/dist/irdevice/other.d.ts.map +1 -1
- package/dist/irdevice/other.js +1 -1
- package/dist/irdevice/other.js.map +1 -1
- package/dist/irdevice/tv.d.ts.map +1 -1
- package/dist/irdevice/tv.js +11 -12
- package/dist/irdevice/tv.js.map +1 -1
- package/dist/irdevice/vacuumcleaner.d.ts.map +1 -1
- package/dist/irdevice/vacuumcleaner.js +2 -3
- package/dist/irdevice/vacuumcleaner.js.map +1 -1
- package/dist/irdevice/waterheater.d.ts.map +1 -1
- package/dist/irdevice/waterheater.js +2 -3
- package/dist/irdevice/waterheater.js.map +1 -1
- package/package.json +1 -1
- package/src/device/bot.ts +3 -3
- package/src/device/colorbulb.ts +74 -74
- package/src/device/contact.ts +3 -3
- package/src/device/curtain.ts +2 -2
- package/src/device/humidifier.ts +2 -2
- package/src/device/lock.ts +92 -1
- package/src/device/meter.ts +2 -2
- package/src/device/meterplus.ts +2 -2
- package/src/device/motion.ts +3 -3
- package/src/device/plug.ts +2 -2
- package/src/device/striplight.ts +2 -2
- package/src/irdevice/airconditioner.ts +20 -37
- package/src/irdevice/airpurifier.ts +4 -5
- package/src/irdevice/camera.ts +3 -4
- package/src/irdevice/fan.ts +11 -10
- package/src/irdevice/light.ts +2 -3
- package/src/irdevice/other.ts +1 -1
- package/src/irdevice/tv.ts +11 -12
- package/src/irdevice/vacuumcleaner.ts +2 -3
- package/src/irdevice/waterheater.ts +2 -3
package/src/irdevice/light.ts
CHANGED
|
@@ -70,7 +70,6 @@ export class Light {
|
|
|
70
70
|
* they are updated, so we are only updating the accessory state after calling the above.
|
|
71
71
|
*/
|
|
72
72
|
this.On = value;
|
|
73
|
-
this.accessory.context.On = this.On;
|
|
74
73
|
}
|
|
75
74
|
|
|
76
75
|
/**
|
|
@@ -84,7 +83,7 @@ export class Light {
|
|
|
84
83
|
* Light - "command" "channelSub" "default" = previous channel
|
|
85
84
|
*/
|
|
86
85
|
async pushLightOnChanges(): Promise<void> {
|
|
87
|
-
if (this.On) {
|
|
86
|
+
if (this.On || this.allowPushOn) {
|
|
88
87
|
const commandType: string = await this.commandType();
|
|
89
88
|
const command: string = await this.commandOn();
|
|
90
89
|
const body = superStringify({
|
|
@@ -97,7 +96,7 @@ export class Light {
|
|
|
97
96
|
}
|
|
98
97
|
|
|
99
98
|
async pushLightOffChanges(): Promise<void> {
|
|
100
|
-
if (!this.On) {
|
|
99
|
+
if (!this.On || this.allowPushOff) {
|
|
101
100
|
const commandType: string = await this.commandType();
|
|
102
101
|
const command: string = await this.commandOff();
|
|
103
102
|
const body = superStringify({
|
package/src/irdevice/other.ts
CHANGED
|
@@ -78,7 +78,6 @@ export class Others {
|
|
|
78
78
|
* they are updated, so we are only updating the accessory state after calling the above.
|
|
79
79
|
*/
|
|
80
80
|
this.Active = value;
|
|
81
|
-
this.accessory.context.Active = this.Active;
|
|
82
81
|
}
|
|
83
82
|
|
|
84
83
|
/**
|
|
@@ -182,6 +181,7 @@ export class Others {
|
|
|
182
181
|
if (this.Active === undefined) {
|
|
183
182
|
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Active: ${this.Active}`);
|
|
184
183
|
} else {
|
|
184
|
+
this.accessory.context.Active = this.Active;
|
|
185
185
|
this.fanService?.updateCharacteristic(this.platform.Characteristic.Active, this.Active);
|
|
186
186
|
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} updateCharacteristic Active: ${this.Active}`);
|
|
187
187
|
}
|
package/src/irdevice/tv.ts
CHANGED
|
@@ -202,8 +202,6 @@ export class TV {
|
|
|
202
202
|
|
|
203
203
|
async ActiveSet(value: CharacteristicValue): Promise<void> {
|
|
204
204
|
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Active: ${value}`);
|
|
205
|
-
this.Active = value;
|
|
206
|
-
this.accessory.context.Active = this.Active;
|
|
207
205
|
if (!this.device.irtv?.disable_power) {
|
|
208
206
|
if (value === this.platform.Characteristic.Active.INACTIVE) {
|
|
209
207
|
await this.pushTvOffChanges();
|
|
@@ -215,7 +213,6 @@ export class TV {
|
|
|
215
213
|
* they are updated, so we are only updating the accessory state after calling the above.
|
|
216
214
|
*/
|
|
217
215
|
this.Active = value;
|
|
218
|
-
this.accessory.context.Active = this.Active;
|
|
219
216
|
}
|
|
220
217
|
}
|
|
221
218
|
|
|
@@ -230,7 +227,7 @@ export class TV {
|
|
|
230
227
|
* TV "command" "channelSub" "default" previous channel
|
|
231
228
|
*/
|
|
232
229
|
async pushTvOnChanges(): Promise<void> {
|
|
233
|
-
if (this.Active
|
|
230
|
+
if (this.Active === this.platform.Characteristic.Active.INACTIVE || this.allowPushOn) {
|
|
234
231
|
const commandType: string = await this.commandType();
|
|
235
232
|
const command: string = await this.commandOn();
|
|
236
233
|
const body = superStringify({
|
|
@@ -243,14 +240,16 @@ export class TV {
|
|
|
243
240
|
}
|
|
244
241
|
|
|
245
242
|
async pushTvOffChanges(): Promise<void> {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
243
|
+
if (this.Active === this.platform.Characteristic.Active.ACTIVE || this.allowPushOn) {
|
|
244
|
+
const commandType: string = await this.commandType();
|
|
245
|
+
const command: string = await this.commandOff();
|
|
246
|
+
const body = superStringify({
|
|
247
|
+
'command': command,
|
|
248
|
+
'parameter': 'default',
|
|
249
|
+
'commandType': commandType,
|
|
250
|
+
});
|
|
251
|
+
await this.pushTVChanges(body);
|
|
252
|
+
}
|
|
254
253
|
}
|
|
255
254
|
|
|
256
255
|
async pushOkChanges(): Promise<void> {
|
|
@@ -70,7 +70,6 @@ export class VacuumCleaner {
|
|
|
70
70
|
* they are updated, so we are only updating the accessory state after calling the above.
|
|
71
71
|
*/
|
|
72
72
|
this.On = value;
|
|
73
|
-
this.accessory.context.On = this.On;
|
|
74
73
|
}
|
|
75
74
|
|
|
76
75
|
/**
|
|
@@ -80,7 +79,7 @@ export class VacuumCleaner {
|
|
|
80
79
|
* Vacuum Cleaner "command" "turnOn" "default" set to ON state
|
|
81
80
|
*/
|
|
82
81
|
async pushOnChanges(): Promise<void> {
|
|
83
|
-
if (this.On) {
|
|
82
|
+
if (this.On || this.allowPushOn) {
|
|
84
83
|
const commandType: string = await this.commandType();
|
|
85
84
|
const command: string = await this.commandOn();
|
|
86
85
|
const body = superStringify({
|
|
@@ -93,7 +92,7 @@ export class VacuumCleaner {
|
|
|
93
92
|
}
|
|
94
93
|
|
|
95
94
|
async pushOffChanges(): Promise<void> {
|
|
96
|
-
if (!this.On) {
|
|
95
|
+
if (!this.On || this.allowPushOff) {
|
|
97
96
|
const commandType: string = await this.commandType();
|
|
98
97
|
const command: string = await this.commandOff();
|
|
99
98
|
const body = superStringify({
|
|
@@ -76,7 +76,6 @@ export class WaterHeater {
|
|
|
76
76
|
* they are updated, so we are only updating the accessory state after calling the above.
|
|
77
77
|
*/
|
|
78
78
|
this.Active = value;
|
|
79
|
-
this.accessory.context.Active = this.Active;
|
|
80
79
|
}
|
|
81
80
|
|
|
82
81
|
/**
|
|
@@ -86,7 +85,7 @@ export class WaterHeater {
|
|
|
86
85
|
* WaterHeater "command" "turnOn" "default" set to ON state
|
|
87
86
|
*/
|
|
88
87
|
async pushWaterHeaterOnChanges(): Promise<void> {
|
|
89
|
-
if (this.Active
|
|
88
|
+
if (this.Active === this.platform.Characteristic.Active.INACTIVE || this.allowPushOn) {
|
|
90
89
|
const commandType: string = await this.commandType();
|
|
91
90
|
const command: string = await this.commandOn();
|
|
92
91
|
const body = superStringify({
|
|
@@ -99,7 +98,7 @@ export class WaterHeater {
|
|
|
99
98
|
}
|
|
100
99
|
|
|
101
100
|
async pushWaterHeaterOffChanges(): Promise<void> {
|
|
102
|
-
if (this.Active
|
|
101
|
+
if (this.Active === this.platform.Characteristic.Active.ACTIVE || this.allowPushOff) {
|
|
103
102
|
const commandType: string = await this.commandType();
|
|
104
103
|
const command: string = await this.commandOff();
|
|
105
104
|
const body = superStringify({
|