mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Add default mode 'auto' for tradfri starkvind air purifier on turn on (#63641)
* add default mode 'auto' for tradfri starkvind air purifier on turn on This commits fixes the behaviour described in #60122 (purifier couldn't be started via toggle switch). It adds 'auto' as default mode/fallback for turning on the starkvind air purifier. This is now the same behaviour the original app provides. * Refactor code that set 'auto' as default value for tradfri starkvind on turn on
This commit is contained in:
parent
8c51303332
commit
ec508130d2
@ -142,7 +142,7 @@ class TradfriAirPurifierFan(TradfriBaseDevice, FanEntity):
|
||||
preset_mode: str | None = None,
|
||||
**kwargs: Any,
|
||||
) -> None:
|
||||
"""Turn on the fan."""
|
||||
"""Turn on the fan. Auto-mode if no argument is given."""
|
||||
if not self._device_control:
|
||||
return
|
||||
|
||||
@ -150,8 +150,8 @@ class TradfriAirPurifierFan(TradfriBaseDevice, FanEntity):
|
||||
await self._api(self._device_control.set_mode(_from_percentage(percentage)))
|
||||
return
|
||||
|
||||
if preset_mode:
|
||||
await self.async_set_preset_mode(preset_mode)
|
||||
preset_mode = preset_mode or ATTR_AUTO
|
||||
await self.async_set_preset_mode(preset_mode)
|
||||
|
||||
async def async_set_percentage(self, percentage: int) -> None:
|
||||
"""Set the speed percentage of the fan."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user