Improve type hints in hive (#77586)

This commit is contained in:
epenet 2022-08-31 22:19:44 +02:00 committed by GitHub
parent c15faa161b
commit 86c7f0bbac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)