From 6afa4d6914681fde7ece8f20c803f22efbd4b3cd Mon Sep 17 00:00:00 2001 From: Teemu R Date: Tue, 29 Jun 2021 19:14:34 +0200 Subject: [PATCH] Skip updating tplink bulb state if the new state not reported by the device (#52310) --- homeassistant/components/tplink/light.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/tplink/light.py b/homeassistant/components/tplink/light.py index e5217cbc143..6d497812261 100644 --- a/homeassistant/components/tplink/light.py +++ b/homeassistant/components/tplink/light.py @@ -432,7 +432,10 @@ class TPLinkSmartBulb(LightEntity): self._is_setting_light_state = False if LIGHT_STATE_ERROR_MSG in light_state_params: raise HomeAssistantError(light_state_params[LIGHT_STATE_ERROR_MSG]) - self._light_state = self._light_state_from_params(light_state_params) + # Some devices do not report the new state in their responses, so we skip + # set here and wait for the next poll to update the values. See #47600 + if LIGHT_STATE_ON_OFF in light_state_params: + self._light_state = self._light_state_from_params(light_state_params) return except (SmartDeviceException, OSError): pass