Skip to content

Commit

Permalink
Fix bloom temperature (convert float to int)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyr-ius committed Nov 18, 2023
1 parent 171baed commit 7c7ce9b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions custom_components/heatzy/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,7 @@ class Bloomv1Thermostat(HeatzyPiloteV2Thermostat):
_attr_supported_features = (
ClimateEntityFeature.PRESET_MODE | ClimateEntityFeature.TARGET_TEMPERATURE_RANGE
)
_attr_target_temperature_step = 1

@property
def current_temperature(self) -> float:
Expand Down Expand Up @@ -529,13 +530,18 @@ async def async_set_temperature(self, **kwargs: Any) -> None:
if (temp_eco := kwargs.get(ATTR_TARGET_TEMP_LOW)) and (
temp_cft := kwargs.get(ATTR_TARGET_TEMP_HIGH)
):
self._attr[CONF_ECO_TEMP] = temp_eco
self._attr[CONF_COM_TEMP] = temp_cft
self._attr[CONF_ECO_TEMP] = int(temp_eco)
self._attr[CONF_COM_TEMP] = int(temp_cft)

try:
await self.coordinator.api.async_control_device(
self.unique_id,
{CONF_ATTRS: {CONF_COM_TEMP: temp_cft, CONF_ECO_TEMP: temp_eco}},
{
CONF_ATTRS: {
CONF_COM_TEMP: self._attr[CONF_COM_TEMP],
CONF_ECO_TEMP: self._attr[CONF_ECO_TEMP],
}
},
)
await self.coordinator.async_request_refresh()
except HeatzyException as error:
Expand Down
2 changes: 1 addition & 1 deletion custom_components/heatzy/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"issue_tracker": "https://github.com/cyr-ius/hass-heatzy/issues",
"loggers": ["heatzypy"],
"requirements": ["heatzypy==2.1.5"],
"version": "5.9.6-beta4"
"version": "5.9.6-beta5"
}

0 comments on commit 7c7ce9b

Please sign in to comment.