Skip to content

Commit 760b69d

Browse files
authored
Only send integers when setting Huum sauna temperature (home-assistant#149380)
1 parent 6adcd34 commit 760b69d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

homeassistant/components/huum/climate.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,10 @@ def target_temperature(self) -> int:
8989
async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None:
9090
"""Set hvac mode."""
9191
if hvac_mode == HVACMode.HEAT:
92-
await self._turn_on(self.target_temperature)
92+
# Make sure to send integers
93+
# The temperature is not always an integer if the user uses Fahrenheit
94+
temperature = int(self.target_temperature)
95+
await self._turn_on(temperature)
9396
elif hvac_mode == HVACMode.OFF:
9497
await self.coordinator.huum.turn_off()
9598
await self.coordinator.async_refresh()
@@ -99,6 +102,7 @@ async def async_set_temperature(self, **kwargs: Any) -> None:
99102
temperature = kwargs.get(ATTR_TEMPERATURE)
100103
if temperature is None or self.hvac_mode != HVACMode.HEAT:
101104
return
105+
temperature = int(temperature)
102106

103107
await self._turn_on(temperature)
104108
await self.coordinator.async_refresh()

0 commit comments

Comments
 (0)