homebridge-winix-purifiers 2.0.3 → 2.0.4
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/accessory.js +5 -2
- package/package.json +1 -1
package/dist/accessory.js
CHANGED
|
@@ -230,7 +230,7 @@ class WinixPurifierAccessory {
|
|
|
230
230
|
async getAmbientLight() {
|
|
231
231
|
const ambientLight = await this.device.getAmbientLight();
|
|
232
232
|
// Fix ambient light value under 0.0001 warning
|
|
233
|
-
const fixedAmbientLight =
|
|
233
|
+
const fixedAmbientLight = this.toAmbientLight(ambientLight);
|
|
234
234
|
this.log.debug('accessory:getAmbientLight():', 'measured:', ambientLight, 'fixed:', fixedAmbientLight);
|
|
235
235
|
return fixedAmbientLight;
|
|
236
236
|
}
|
|
@@ -327,7 +327,7 @@ class WinixPurifierAccessory {
|
|
|
327
327
|
this.plasmawave?.updateCharacteristic(this.Characteristic.On, this.toSwitch(plasmawave));
|
|
328
328
|
}
|
|
329
329
|
if (this.ambientLight !== undefined) {
|
|
330
|
-
this.ambientLight?.updateCharacteristic(this.Characteristic.CurrentAmbientLightLevel, ambientLight);
|
|
330
|
+
this.ambientLight?.updateCharacteristic(this.Characteristic.CurrentAmbientLightLevel, this.toAmbientLight(ambientLight));
|
|
331
331
|
}
|
|
332
332
|
if (this.autoSwitch !== undefined) {
|
|
333
333
|
this.autoSwitch?.updateCharacteristic(this.Characteristic.On, this.toTargetState(mode) === this.Characteristic.TargetAirPurifierState.AUTO);
|
|
@@ -414,6 +414,9 @@ class WinixPurifierAccessory {
|
|
|
414
414
|
toPlasmawave(state) {
|
|
415
415
|
return state ? winix_api_1.Plasmawave.On : winix_api_1.Plasmawave.Off;
|
|
416
416
|
}
|
|
417
|
+
toAmbientLight(ambientLight) {
|
|
418
|
+
return Math.max(ambientLight, MIN_AMBIENT_LIGHT);
|
|
419
|
+
}
|
|
417
420
|
debounce(func, delay) {
|
|
418
421
|
let timeoutId = null;
|
|
419
422
|
return async (arg) => {
|
package/package.json
CHANGED