From 69843e9ac44e604bb2790de17a54617be0a67e0e Mon Sep 17 00:00:00 2001 From: Eric Trudeau Date: Sun, 18 Aug 2024 06:42:05 -0700 Subject: [PATCH] Add support for Levoit EverestAir air purifiers (#123428) --- homeassistant/components/vesync/const.py | 6 ++++++ homeassistant/components/vesync/fan.py | 7 ++++++- homeassistant/components/vesync/sensor.py | 10 +++++++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/vesync/const.py b/homeassistant/components/vesync/const.py index 54fc21d2659..50dce95e42a 100644 --- a/homeassistant/components/vesync/const.py +++ b/homeassistant/components/vesync/const.py @@ -23,6 +23,7 @@ DEV_TYPE_TO_HA = { "Core300S": "fan", "Core400S": "fan", "Core600S": "fan", + "EverestAir": "fan", "Vital200S": "fan", "Vital100S": "fan", "ESD16": "walldimmer", @@ -60,4 +61,9 @@ SKU_TO_BASE_DEVICE = { "LAP-V102S-AASR": "Vital100S", # Alt ID Model Vital100S "LAP-V102S-WEU": "Vital100S", # Alt ID Model Vital100S "LAP-V102S-WUK": "Vital100S", # Alt ID Model Vital100S + "EverestAir": "EverestAir", + "LAP-EL551S-AUS": "EverestAir", # Alt ID Model EverestAir + "LAP-EL551S-AEUR": "EverestAir", # Alt ID Model EverestAir + "LAP-EL551S-WEU": "EverestAir", # Alt ID Model EverestAir + "LAP-EL551S-WUS": "EverestAir", # Alt ID Model EverestAir } diff --git a/homeassistant/components/vesync/fan.py b/homeassistant/components/vesync/fan.py index 4dce2762eef..6ef9e41eb43 100644 --- a/homeassistant/components/vesync/fan.py +++ b/homeassistant/components/vesync/fan.py @@ -25,6 +25,7 @@ _LOGGER = logging.getLogger(__name__) FAN_MODE_AUTO = "auto" FAN_MODE_SLEEP = "sleep" FAN_MODE_PET = "pet" +FAN_MODE_TURBO = "turbo" PRESET_MODES = { "LV-PUR131S": [FAN_MODE_AUTO, FAN_MODE_SLEEP], @@ -32,6 +33,7 @@ PRESET_MODES = { "Core300S": [FAN_MODE_AUTO, FAN_MODE_SLEEP], "Core400S": [FAN_MODE_AUTO, FAN_MODE_SLEEP], "Core600S": [FAN_MODE_AUTO, FAN_MODE_SLEEP], + "EverestAir": [FAN_MODE_AUTO, FAN_MODE_SLEEP, FAN_MODE_TURBO], "Vital200S": [FAN_MODE_AUTO, FAN_MODE_SLEEP, FAN_MODE_PET], "Vital100S": [FAN_MODE_AUTO, FAN_MODE_SLEEP, FAN_MODE_PET], } @@ -41,6 +43,7 @@ SPEED_RANGE = { # off is not included "Core300S": (1, 3), "Core400S": (1, 4), "Core600S": (1, 4), + "EverestAir": (1, 3), "Vital200S": (1, 4), "Vital100S": (1, 4), } @@ -125,7 +128,7 @@ class VeSyncFanHA(VeSyncDevice, FanEntity): @property def preset_mode(self) -> str | None: """Get the current preset mode.""" - if self.smartfan.mode in (FAN_MODE_AUTO, FAN_MODE_SLEEP): + if self.smartfan.mode in (FAN_MODE_AUTO, FAN_MODE_SLEEP, FAN_MODE_TURBO): return self.smartfan.mode return None @@ -192,6 +195,8 @@ class VeSyncFanHA(VeSyncDevice, FanEntity): self.smartfan.sleep_mode() elif preset_mode == FAN_MODE_PET: self.smartfan.pet_mode() + elif preset_mode == FAN_MODE_TURBO: + self.smartfan.turbo_mode() self.schedule_update_ha_state() diff --git a/homeassistant/components/vesync/sensor.py b/homeassistant/components/vesync/sensor.py index 81f42f4c2ee..8939295a2db 100644 --- a/homeassistant/components/vesync/sensor.py +++ b/homeassistant/components/vesync/sensor.py @@ -72,6 +72,7 @@ FILTER_LIFE_SUPPORTED = [ "Core300S", "Core400S", "Core600S", + "EverestAir", "Vital100S", "Vital200S", ] @@ -83,7 +84,14 @@ AIR_QUALITY_SUPPORTED = [ "Vital100S", "Vital200S", ] -PM25_SUPPORTED = ["Core300S", "Core400S", "Core600S", "Vital100S", "Vital200S"] +PM25_SUPPORTED = [ + "Core300S", + "Core400S", + "Core600S", + "EverestAir", + "Vital100S", + "Vital200S", +] SENSORS: tuple[VeSyncSensorEntityDescription, ...] = ( VeSyncSensorEntityDescription(