From a1e7459dc52e763f9575b46369993ef5b8da7ec3 Mon Sep 17 00:00:00 2001 From: Simone Chemelli Date: Sun, 16 Jan 2022 15:28:49 +0100 Subject: [PATCH] Fix misuse of cast for Shelly Valve (#64181) --- homeassistant/components/shelly/climate.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/shelly/climate.py b/homeassistant/components/shelly/climate.py index 810d662f75f..ffc66215678 100644 --- a/homeassistant/components/shelly/climate.py +++ b/homeassistant/components/shelly/climate.py @@ -145,9 +145,10 @@ class BlockSleepingClimate( if self.block is not None and self.device_block is not None: self._unique_id = f"{self.wrapper.mac}-{self.block.description}" + assert self.block.channel self._preset_modes = [ PRESET_NONE, - *wrapper.device.settings["thermostats"][cast(int, self.block.channel)][ + *wrapper.device.settings["thermostats"][int(self.block.channel)][ "schedule_profile_names" ], ]