From 86c7f0bbacc59d00219b7f046150bd1bbf8da760 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Wed, 31 Aug 2022 22:19:44 +0200 Subject: [PATCH] Improve type hints in hive (#77586) --- homeassistant/components/hive/climate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/hive/climate.py b/homeassistant/components/hive/climate.py index b6f4f8270b4..8e33dda244a 100644 --- a/homeassistant/components/hive/climate.py +++ b/homeassistant/components/hive/climate.py @@ -128,12 +128,12 @@ class HiveClimateEntity(HiveEntity, ClimateEntity): await self.hive.heating.setTargetTemperature(self.device, new_temperature) @refresh_system - async def async_set_preset_mode(self, preset_mode): + async def async_set_preset_mode(self, preset_mode: str) -> None: """Set new preset mode.""" if preset_mode == PRESET_NONE and self.preset_mode == PRESET_BOOST: await self.hive.heating.setBoostOff(self.device) elif preset_mode == PRESET_BOOST: - curtemp = round(self.current_temperature * 2) / 2 + curtemp = round((self.current_temperature or 0) * 2) / 2 temperature = curtemp + 0.5 await self.hive.heating.setBoostOn(self.device, 30, temperature) -- GitLab