Only send integers when setting Huum sauna temperature (#149380)

This commit is contained in:
Frank Wickström 2025-07-24 18:13:54 +03:00 committed by GitHub
parent 6adcd34521
commit 760b69d458
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -89,7 +89,10 @@ class HuumDevice(HuumBaseEntity, ClimateEntity):
async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None: async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None:
"""Set hvac mode.""" """Set hvac mode."""
if hvac_mode == HVACMode.HEAT: if hvac_mode == HVACMode.HEAT:
await self._turn_on(self.target_temperature) # Make sure to send integers
# The temperature is not always an integer if the user uses Fahrenheit
temperature = int(self.target_temperature)
await self._turn_on(temperature)
elif hvac_mode == HVACMode.OFF: elif hvac_mode == HVACMode.OFF:
await self.coordinator.huum.turn_off() await self.coordinator.huum.turn_off()
await self.coordinator.async_refresh() await self.coordinator.async_refresh()
@ -99,6 +102,7 @@ class HuumDevice(HuumBaseEntity, ClimateEntity):
temperature = kwargs.get(ATTR_TEMPERATURE) temperature = kwargs.get(ATTR_TEMPERATURE)
if temperature is None or self.hvac_mode != HVACMode.HEAT: if temperature is None or self.hvac_mode != HVACMode.HEAT:
return return
temperature = int(temperature)
await self._turn_on(temperature) await self._turn_on(temperature)
await self.coordinator.async_refresh() await self.coordinator.async_refresh()