mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 13:47:35 +00:00
Remove auto from the fan speed modes for VeSync (#40559)
This commit is contained in:
parent
25bfaf6c0d
commit
318096be79
@ -21,8 +21,8 @@ DEV_TYPE_TO_HA = {
|
|||||||
"LV-PUR131S": "fan",
|
"LV-PUR131S": "fan",
|
||||||
}
|
}
|
||||||
|
|
||||||
SPEED_AUTO = "auto"
|
FAN_SPEEDS = [SPEED_OFF, SPEED_LOW, SPEED_MEDIUM, SPEED_HIGH]
|
||||||
FAN_SPEEDS = [SPEED_AUTO, SPEED_OFF, SPEED_LOW, SPEED_MEDIUM, SPEED_HIGH]
|
FAN_MODE_AUTO = "auto"
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(hass, config_entry, async_add_entities):
|
async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||||
@ -36,7 +36,6 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
|||||||
hass.data[DOMAIN][VS_DISPATCHERS].append(disp)
|
hass.data[DOMAIN][VS_DISPATCHERS].append(disp)
|
||||||
|
|
||||||
_async_setup_entities(hass.data[DOMAIN][VS_FANS], async_add_entities)
|
_async_setup_entities(hass.data[DOMAIN][VS_FANS], async_add_entities)
|
||||||
return True
|
|
||||||
|
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
@ -71,8 +70,8 @@ class VeSyncFanHA(VeSyncDevice, FanEntity):
|
|||||||
@property
|
@property
|
||||||
def speed(self):
|
def speed(self):
|
||||||
"""Return the current speed."""
|
"""Return the current speed."""
|
||||||
if self.smartfan.mode == SPEED_AUTO:
|
if self.smartfan.mode == FAN_MODE_AUTO:
|
||||||
return SPEED_AUTO
|
return None
|
||||||
if self.smartfan.mode == "manual":
|
if self.smartfan.mode == "manual":
|
||||||
current_level = self.smartfan.fan_level
|
current_level = self.smartfan.fan_level
|
||||||
if current_level is not None:
|
if current_level is not None:
|
||||||
@ -105,11 +104,8 @@ class VeSyncFanHA(VeSyncDevice, FanEntity):
|
|||||||
if not self.smartfan.is_on:
|
if not self.smartfan.is_on:
|
||||||
self.smartfan.turn_on()
|
self.smartfan.turn_on()
|
||||||
|
|
||||||
if speed is None or speed == SPEED_AUTO:
|
self.smartfan.manual_mode()
|
||||||
self.smartfan.auto_mode()
|
self.smartfan.change_fan_speed(FAN_SPEEDS.index(speed))
|
||||||
else:
|
|
||||||
self.smartfan.manual_mode()
|
|
||||||
self.smartfan.change_fan_speed(FAN_SPEEDS.index(speed))
|
|
||||||
|
|
||||||
def turn_on(self, speed: str = None, **kwargs) -> None:
|
def turn_on(self, speed: str = None, **kwargs) -> None:
|
||||||
"""Turn the device on."""
|
"""Turn the device on."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user