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 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 = Math.max(ambientLight, MIN_AMBIENT_LIGHT);
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
@@ -2,7 +2,7 @@
2
2
  "private": false,
3
3
  "displayName": "Winix Air Purifiers",
4
4
  "name": "homebridge-winix-purifiers",
5
- "version": "2.0.3",
5
+ "version": "2.0.4",
6
6
  "description": "Homebridge plugin for Winix air purifiers",
7
7
  "license": "Apache-2.0",
8
8
  "repository": {