Fix changing the preset mode (#64119)

pull/64058/head
Maciej Bieniek 2022-01-14 17:24:54 +01:00 committed by GitHub
parent b1848cd2f4
commit 3265a09083
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -272,10 +272,10 @@ class BlockSleepingClimate(
async def async_set_preset_mode(self, preset_mode: str) -> None:
"""Set preset mode."""
if not self._attr_preset_modes:
if not self._preset_modes:
return
preset_index = self._attr_preset_modes.index(preset_mode)
preset_index = self._preset_modes.index(preset_mode)
if preset_index == 0:
await self.set_state_full_path(schedule=0)