From 7807df44265f285aa80fd2ca1a867425014c9b17 Mon Sep 17 00:00:00 2001 From: Matrix Date: Fri, 12 May 2023 22:15:04 +0800 Subject: [PATCH] Fix yolink dimmer Incorrect state update (#92986) fix state update --- homeassistant/components/yolink/light.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/yolink/light.py b/homeassistant/components/yolink/light.py index 7c11b54efa5..a7f52e801b2 100644 --- a/homeassistant/components/yolink/light.py +++ b/homeassistant/components/yolink/light.py @@ -51,9 +51,9 @@ class YoLinkDimmerEntity(YoLinkEntity, LightEntity): @callback def update_entity_state(self, state: dict[str, Any]) -> None: """Update HA Entity State.""" - if (dimmer_is_on := state.get("state")) is not None: + if (dimmer_state := state.get("state")) is not None: # update _attr_is_on when device report it's state - self._attr_is_on = dimmer_is_on + self._attr_is_on = dimmer_state == "open" if (brightness := state.get("brightness")) is not None: self._attr_brightness = round(255 * brightness / 100) self.async_write_ha_state()