From 405c4f685cc99b597ed1b0f24db192a5048c62a3 Mon Sep 17 00:00:00 2001 From: Maciej Bieniek Date: Fri, 14 Jan 2022 17:24:54 +0100 Subject: [PATCH] Fix changing the preset mode (#64119) --- homeassistant/components/shelly/climate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/shelly/climate.py b/homeassistant/components/shelly/climate.py index 777a41a6664..21d90adb74b 100644 --- a/homeassistant/components/shelly/climate.py +++ b/homeassistant/components/shelly/climate.py @@ -281,10 +281,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)