From b3596fdea1b330633c3096c9d252bfa6426e3b03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A5le=20Stor=C3=B8=20Hauknes?= Date: Sun, 4 Sep 2022 19:32:57 +0200 Subject: [PATCH] Mill 3. gen add support for PRECISION_HALVES (#73592) * Add support for PRECISION_HALVES for Mill 3. generation heaters * Add support for precision halves for Mill local API * Make sure to cast to float for local api * Support both float for gen 3 heaters and int for gen < 3 heaters when using cloud api * Mill attribute bugfix * Add support for PRECISION_HALVES for Mill 3. generation heaters * Add support for precision halves for Mill local API * Make sure to cast to float for local api * Support both float for gen 3 heaters and int for gen < 3 heaters when using cloud api * Mill attribute bugfix * Revert PRECISION_HALVES for Mill cloud integration * Remove unused code * Revert to casting to int for mill cloud integration * Remove unused code --- homeassistant/components/mill/climate.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/mill/climate.py b/homeassistant/components/mill/climate.py index e7cd297bd59..44c7f980274 100644 --- a/homeassistant/components/mill/climate.py +++ b/homeassistant/components/mill/climate.py @@ -15,6 +15,7 @@ from homeassistant.const import ( ATTR_TEMPERATURE, CONF_IP_ADDRESS, CONF_USERNAME, + PRECISION_HALVES, PRECISION_WHOLE, TEMP_CELSIUS, ) @@ -200,7 +201,7 @@ class LocalMillHeater(CoordinatorEntity, ClimateEntity): _attr_max_temp = MAX_TEMP _attr_min_temp = MIN_TEMP _attr_supported_features = ClimateEntityFeature.TARGET_TEMPERATURE - _attr_target_temperature_step = PRECISION_WHOLE + _attr_target_temperature_step = PRECISION_HALVES _attr_temperature_unit = TEMP_CELSIUS def __init__(self, coordinator): @@ -225,7 +226,7 @@ class LocalMillHeater(CoordinatorEntity, ClimateEntity): if (temperature := kwargs.get(ATTR_TEMPERATURE)) is None: return await self.coordinator.mill_data_connection.set_target_temperature( - int(temperature) + float(temperature) ) await self.coordinator.async_request_refresh()