diff --git a/custom_components/vesync/const.py b/custom_components/vesync/const.py index 70819ea..61ca729 100644 --- a/custom_components/vesync/const.py +++ b/custom_components/vesync/const.py @@ -28,6 +28,7 @@ VS_MODE_MANUAL = "manual" VS_MODE_SLEEP = "sleep" VS_MODE_TURBO = "turbo" +VS_MODE_PET = "pet" VS_TO_HA_ATTRIBUTES = {"humidity": "current_humidity"} diff --git a/custom_components/vesync/fan.py b/custom_components/vesync/fan.py index b54e05b..e69742f 100644 --- a/custom_components/vesync/fan.py +++ b/custom_components/vesync/fan.py @@ -23,6 +23,7 @@ VS_MODE_MANUAL, VS_MODE_SLEEP, VS_MODE_TURBO, + VS_MODE_PET, VS_MODES, VS_TO_HA_ATTRIBUTES, ) @@ -81,6 +82,9 @@ def __init__(self, fan, coordinator) -> None: if mode in self.smartfan._config_dict[VS_MODES] ], ] + if hasattr(self.smartfan, "pet_mode"): + self._attr_preset_modes.append(VS_MODE_PET) + if self.smartfan.device_type == "LV-PUR131S": self._speed_range = (1, 3) @@ -169,6 +173,9 @@ def set_preset_mode(self, preset_mode): self.smartfan.manual_mode() elif preset_mode == VS_MODE_TURBO: self.smartfan.turbo_mode() + elif preset_mode == VS_MODE_PET: + if hasattr(self.smartfan, "pet_mode"): + self.smartfan.pet_mode() self.schedule_update_ha_state()