@switchbot/homebridge-switchbot 3.5.1-beta.11 → 3.5.1-beta.12
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/ceilinglight.d.ts.map +1 -1
- package/dist/device/ceilinglight.js +6 -8
- package/dist/device/ceilinglight.js.map +1 -1
- package/dist/device/colorbulb.d.ts.map +1 -1
- package/dist/device/colorbulb.js +7 -3
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/irdevice/airconditioner.d.ts +1 -3
- package/dist/irdevice/airconditioner.d.ts.map +1 -1
- package/dist/irdevice/airconditioner.js +13 -66
- package/dist/irdevice/airconditioner.js.map +1 -1
- package/dist/irdevice/airpurifier.d.ts +0 -1
- package/dist/irdevice/airpurifier.d.ts.map +1 -1
- package/dist/irdevice/airpurifier.js +9 -40
- package/dist/irdevice/airpurifier.js.map +1 -1
- package/dist/irdevice/irdevice.js +4 -4
- package/dist/irdevice/irdevice.js.map +1 -1
- package/package.json +1 -1
- package/src/device/ceilinglight.ts +6 -11
- package/src/device/colorbulb.ts +7 -10
- package/src/irdevice/airconditioner.ts +22 -60
- package/src/irdevice/airpurifier.ts +14 -36
- package/src/irdevice/irdevice.ts +4 -4
|
@@ -23,6 +23,7 @@ export class AirPurifier extends irdeviceBase {
|
|
|
23
23
|
RotationSpeed: CharacteristicValue;
|
|
24
24
|
CurrentAirPurifierState: CharacteristicValue;
|
|
25
25
|
TargetAirPurifierState: CharacteristicValue;
|
|
26
|
+
CurrentHeaterCoolerState: CharacteristicValue;
|
|
26
27
|
};
|
|
27
28
|
|
|
28
29
|
private TemperatureSensor: {
|
|
@@ -36,7 +37,6 @@ export class AirPurifier extends irdeviceBase {
|
|
|
36
37
|
CurrentAPTemp!: CharacteristicValue;
|
|
37
38
|
CurrentAPMode!: CharacteristicValue;
|
|
38
39
|
CurrentAPFanSpeed!: CharacteristicValue;
|
|
39
|
-
CurrentHeaterCoolerState!: CharacteristicValue;
|
|
40
40
|
|
|
41
41
|
// Others
|
|
42
42
|
Busy: any;
|
|
@@ -64,6 +64,7 @@ export class AirPurifier extends irdeviceBase {
|
|
|
64
64
|
RotationSpeed: accessory.context.RotationSpeed ?? 0,
|
|
65
65
|
CurrentAirPurifierState: accessory.context.CurrentAirPurifierState ?? this.hap.Characteristic.CurrentAirPurifierState.INACTIVE,
|
|
66
66
|
TargetAirPurifierState: accessory.context.TargetAirPurifierState ?? this.hap.Characteristic.TargetAirPurifierState.AUTO,
|
|
67
|
+
CurrentHeaterCoolerState: accessory.context.CurrentHeaterCoolerState ?? this.hap.Characteristic.CurrentHeaterCoolerState.INACTIVE,
|
|
67
68
|
};
|
|
68
69
|
accessory.context.AirPurifier = this.AirPurifier as object;
|
|
69
70
|
|
|
@@ -187,7 +188,7 @@ export class AirPurifier extends irdeviceBase {
|
|
|
187
188
|
+ ` disablePushOff: ${this.disablePushOff}, disablePushOn: ${this.disablePushOn}`);
|
|
188
189
|
if (!this.Busy) {
|
|
189
190
|
this.Busy = true;
|
|
190
|
-
this.CurrentHeaterCoolerState = this.hap.Characteristic.CurrentHeaterCoolerState.IDLE;
|
|
191
|
+
this.AirPurifier.CurrentHeaterCoolerState = this.hap.Characteristic.CurrentHeaterCoolerState.IDLE;
|
|
191
192
|
}
|
|
192
193
|
clearTimeout(this.Timeout);
|
|
193
194
|
|
|
@@ -210,12 +211,12 @@ export class AirPurifier extends irdeviceBase {
|
|
|
210
211
|
});
|
|
211
212
|
if (this.AirPurifier.Active === 1) {
|
|
212
213
|
if ((Number(this.TemperatureSensor!.CurrentTemperature) || 24) < (this.LastTemperature || 30)) {
|
|
213
|
-
this.CurrentHeaterCoolerState = this.hap.Characteristic.CurrentHeaterCoolerState.COOLING;
|
|
214
|
+
this.AirPurifier.CurrentHeaterCoolerState = this.hap.Characteristic.CurrentHeaterCoolerState.COOLING;
|
|
214
215
|
} else {
|
|
215
|
-
this.CurrentHeaterCoolerState = this.hap.Characteristic.CurrentHeaterCoolerState.HEATING;
|
|
216
|
+
this.AirPurifier.CurrentHeaterCoolerState = this.hap.Characteristic.CurrentHeaterCoolerState.HEATING;
|
|
216
217
|
}
|
|
217
218
|
} else {
|
|
218
|
-
this.CurrentHeaterCoolerState = this.hap.Characteristic.CurrentHeaterCoolerState.INACTIVE;
|
|
219
|
+
this.AirPurifier.CurrentHeaterCoolerState = this.hap.Characteristic.CurrentHeaterCoolerState.INACTIVE;
|
|
219
220
|
}
|
|
220
221
|
await this.pushChanges(bodyChange);
|
|
221
222
|
}
|
|
@@ -247,40 +248,17 @@ export class AirPurifier extends irdeviceBase {
|
|
|
247
248
|
async updateHomeKitCharacteristics(): Promise<void> {
|
|
248
249
|
await this.debugLog('updateHomeKitCharacteristics');
|
|
249
250
|
// Active
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
} else {
|
|
253
|
-
this.accessory.context.Active = this.AirPurifier.Active;
|
|
254
|
-
this.AirPurifier.Service.updateCharacteristic(this.hap.Characteristic.Active, this.AirPurifier.Active);
|
|
255
|
-
await this.debugLog(`updateCharacteristic Active: ${this.AirPurifier.Active}`);
|
|
256
|
-
}
|
|
251
|
+
await this.updateCharacteristic(this.AirPurifier.Service, this.hap.Characteristic.Active,
|
|
252
|
+
this.AirPurifier.Active, 'Active');
|
|
257
253
|
// CurrentAirPurifierState
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
} else {
|
|
261
|
-
this.accessory.context.CurrentAirPurifierState = this.AirPurifier.CurrentAirPurifierState;
|
|
262
|
-
this.AirPurifier.Service.updateCharacteristic(this.hap.Characteristic.CurrentAirPurifierState, this.AirPurifier.CurrentAirPurifierState);
|
|
263
|
-
await this.debugLog('updateCharacteristic'
|
|
264
|
-
+ ` CurrentAirPurifierState: ${this.AirPurifier.CurrentAirPurifierState}`);
|
|
265
|
-
}
|
|
254
|
+
await this.updateCharacteristic(this.AirPurifier.Service, this.hap.Characteristic.CurrentAirPurifierState,
|
|
255
|
+
this.AirPurifier.CurrentAirPurifierState, 'CurrentAirPurifierState');
|
|
266
256
|
// CurrentHeaterCoolerState
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
} else {
|
|
270
|
-
this.accessory.context.CurrentHeaterCoolerState = this.CurrentHeaterCoolerState;
|
|
271
|
-
this.AirPurifier.Service.updateCharacteristic(this.hap.Characteristic.CurrentHeaterCoolerState, this.CurrentHeaterCoolerState);
|
|
272
|
-
await this.debugLog('updateCharacteristic'
|
|
273
|
-
+ ` CurrentHeaterCoolerState: ${this.CurrentHeaterCoolerState}`);
|
|
274
|
-
}
|
|
257
|
+
await this.updateCharacteristic(this.AirPurifier.Service, this.hap.Characteristic.CurrentHeaterCoolerState,
|
|
258
|
+
this.AirPurifier.CurrentHeaterCoolerState, 'CurrentHeaterCoolerState');
|
|
275
259
|
// CurrentTemperature
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
} else {
|
|
279
|
-
this.accessory.context.CurrentTemperature = this.TemperatureSensor.CurrentTemperature;
|
|
280
|
-
this.TemperatureSensor.Service.updateCharacteristic(this.hap.Characteristic.CurrentTemperature, this.TemperatureSensor.CurrentTemperature);
|
|
281
|
-
await this.debugLog('updateCharacteristic'
|
|
282
|
-
+ ` CurrentTemperature: ${this.TemperatureSensor.CurrentTemperature}`);
|
|
283
|
-
}
|
|
260
|
+
await this.updateCharacteristic(this.TemperatureSensor.Service, this.hap.Characteristic.CurrentTemperature,
|
|
261
|
+
this.TemperatureSensor.CurrentTemperature, 'CurrentTemperature');
|
|
284
262
|
}
|
|
285
263
|
|
|
286
264
|
async apiError(e: any): Promise<void> {
|
package/src/irdevice/irdevice.ts
CHANGED
|
@@ -218,13 +218,13 @@ export abstract class irdeviceBase {
|
|
|
218
218
|
async updateCharacteristic(Service: Service, Characteristic: any,
|
|
219
219
|
CharacteristicValue: CharacteristicValue | undefined, CharacteristicName: string): Promise<void> {
|
|
220
220
|
if (CharacteristicValue === undefined) {
|
|
221
|
-
await
|
|
221
|
+
await this.debugLog(`${CharacteristicName}: ${CharacteristicValue}`);
|
|
222
222
|
} else {
|
|
223
223
|
Service.updateCharacteristic(Characteristic, CharacteristicValue);
|
|
224
|
-
await
|
|
225
|
-
await
|
|
224
|
+
await this.debugLog(`updateCharacteristic ${CharacteristicName}: ${CharacteristicValue}`);
|
|
225
|
+
await this.debugWarnLog(`context before: ${this.accessory.context[CharacteristicName]}`);
|
|
226
226
|
this.accessory.context[CharacteristicName] = CharacteristicValue;
|
|
227
|
-
await
|
|
227
|
+
await this.debugWarnLog(`context after: ${this.accessory.context[CharacteristicName]}`);
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
230
|
|