From fc46ed73b68f12146a9782b867e32d4cfe72b813 Mon Sep 17 00:00:00 2001 From: rwjack <59068073+rwjack@users.noreply.github.com> Date: Sun, 25 Aug 2024 20:03:13 +0200 Subject: [PATCH] Fix #1017 (#1038) --- custom_components/adaptive_lighting/switch.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/custom_components/adaptive_lighting/switch.py b/custom_components/adaptive_lighting/switch.py index 98a33021..893e7565 100644 --- a/custom_components/adaptive_lighting/switch.py +++ b/custom_components/adaptive_lighting/switch.py @@ -72,6 +72,7 @@ from homeassistant.core import ( callback, ) from homeassistant.helpers import entity_platform, entity_registry +from homeassistant.helpers.entity_component import async_update_entity if [MAJOR_VERSION, MINOR_VERSION] < [2023, 9]: from homeassistant.helpers.entity import DeviceInfo @@ -2492,7 +2493,7 @@ class AdaptiveLightingManager: # Ensure HASS is correctly updating your light's state with # light.turn_on calls if any problems arise. This # can happen e.g. using zigbee2mqtt with 'report: false' in device settings. - await self.hass.helpers.entity_component.async_update_entity(light) + await async_update_entity(self.hass, light) refreshed_state = self.hass.states.get(light) assert refreshed_state is not None