Add support for Levoit EverestAir air purifiers (#123428)

This commit is contained in:
Eric Trudeau 2024-08-18 06:42:05 -07:00 committed by GitHub
parent a4fb4e76cb
commit 69843e9ac4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 21 additions and 2 deletions

View file

@ -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
}

View file

@ -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()

View file

@ -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(