From dcd057ff6ca0afb161152938035b790dad9b3cec Mon Sep 17 00:00:00 2001 From: = Date: Sun, 7 May 2023 20:06:31 +0100 Subject: [PATCH] update for compatibility with HA 2023.5 --- custom_components/zoned_heating/__init__.py | 2 +- custom_components/zoned_heating/switch.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/zoned_heating/__init__.py b/custom_components/zoned_heating/__init__.py index 85786f4..8c7ccf7 100755 --- a/custom_components/zoned_heating/__init__.py +++ b/custom_components/zoned_heating/__init__.py @@ -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)) diff --git a/custom_components/zoned_heating/switch.py b/custom_components/zoned_heating/switch.py index b67fa0f..8e8e8fe 100755 --- a/custom_components/zoned_heating/switch.py +++ b/custom_components/zoned_heating/switch.py @@ -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") @@ -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"""