Skip to content
Snippets Groups Projects
Unverified Commit 86c7f0bb authored by epenet's avatar epenet Committed by GitHub
Browse files

Improve type hints in hive (#77586)

parent c15faa16
No related branches found
No related tags found
No related merge requests found
...@@ -128,12 +128,12 @@ class HiveClimateEntity(HiveEntity, ClimateEntity): ...@@ -128,12 +128,12 @@ class HiveClimateEntity(HiveEntity, ClimateEntity):
await self.hive.heating.setTargetTemperature(self.device, new_temperature) await self.hive.heating.setTargetTemperature(self.device, new_temperature)
@refresh_system @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.""" """Set new preset mode."""
if preset_mode == PRESET_NONE and self.preset_mode == PRESET_BOOST: if preset_mode == PRESET_NONE and self.preset_mode == PRESET_BOOST:
await self.hive.heating.setBoostOff(self.device) await self.hive.heating.setBoostOff(self.device)
elif preset_mode == PRESET_BOOST: 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 temperature = curtemp + 0.5
await self.hive.heating.setBoostOn(self.device, 30, temperature) await self.hive.heating.setBoostOn(self.device, 30, temperature)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment