Skip to content

Commit

Permalink
update for compatibility with HA 2023.5
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsfaber committed May 7, 2023
1 parent c676a0a commit dcd057f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion custom_components/zoned_heating/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
hass.data[const.DOMAIN][entry.entry_id] = {}

# Set up all platforms for this device/entry.
await hass.config_entries.async_forward_entry_setup(entry, "switch")
await hass.config_entries.async_forward_entry_setups(entry, [Platform.SWITCH])

# Reload entry when its updated.
entry.async_on_unload(entry.add_update_listener(async_reload_entry))
Expand Down
4 changes: 2 additions & 2 deletions custom_components/zoned_heating/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ async def async_controller_state_changed(self, entity, old_state, new_state):
# if controller setpoint has changed, make sure to store it
_LOGGER.debug("Storing controller setpoint={}".format(new_state[ATTR_TEMPERATURE]))
self._stored_controller_setpoint = new_state[ATTR_TEMPERATURE]
await self.async_update_ha_state()
self.async_write_ha_state()

if new_state[ATTR_HVAC_MODE] != old_state[ATTR_HVAC_MODE] and new_state[ATTR_HVAC_MODE] == HVAC_MODE_OFF:
_LOGGER.debug("Controller was turned off, disable zones")
Expand Down Expand Up @@ -232,7 +232,7 @@ async def async_calculate_override(self):
else:
await self.async_update_override_setpoint(temperature_increase)

await self.async_update_ha_state()
self.async_write_ha_state()

async def async_start_override_mode(self, temperature_increase: float):
"""Start the override of the controller"""
Expand Down

0 comments on commit dcd057f

Please sign in to comment.