mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +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,
|
**kwargs,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Turn the device on."""
|
"""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
|
# Remove the async_set_speed call is async_set_percentage and async_set_preset_modes have been implemented
|
||||||
if speed:
|
if speed:
|
||||||
await self.async_set_speed(speed)
|
await self.async_set_speed(speed)
|
||||||
@ -623,10 +627,6 @@ class XiaomiGenericDevice(XiaomiMiioEntity, FanEntity):
|
|||||||
await self.async_set_percentage(percentage)
|
await self.async_set_percentage(percentage)
|
||||||
if preset_mode:
|
if preset_mode:
|
||||||
await self.async_set_preset_mode(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:
|
if result:
|
||||||
self._state = True
|
self._state = True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user