mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Fix Xiaomi-miio turn fan on with speed, percentage or preset (#54353)
This commit is contained in:
parent
4133cc05eb
commit
d55c764048
@ -615,6 +615,10 @@ class XiaomiGenericDevice(XiaomiMiioEntity, FanEntity):
|
||||
**kwargs,
|
||||
) -> None:
|
||||
"""Turn the device on."""
|
||||
result = await self._try_command(
|
||||
"Turning the miio device on failed.", self._device.on
|
||||
)
|
||||
|
||||
# Remove the async_set_speed call is async_set_percentage and async_set_preset_modes have been implemented
|
||||
if speed:
|
||||
await self.async_set_speed(speed)
|
||||
@ -623,10 +627,6 @@ class XiaomiGenericDevice(XiaomiMiioEntity, FanEntity):
|
||||
await self.async_set_percentage(percentage)
|
||||
if preset_mode:
|
||||
await self.async_set_preset_mode(preset_mode)
|
||||
else:
|
||||
result = await self._try_command(
|
||||
"Turning the miio device on failed.", self._device.on
|
||||
)
|
||||
|
||||
if result:
|
||||
self._state = True
|
||||
|
Loading…
x
Reference in New Issue
Block a user