From 6239a523ccf9308a348e0ec96979278bdc5d4ce1 Mon Sep 17 00:00:00 2001 From: Nikolay Vasilchuk Date: Thu, 18 Oct 2018 21:28:43 +0300 Subject: [PATCH] Fix: Xiaomi Plug state is set twice (#17482) * Xiaomi Plug UI fix #17422 * Review --- homeassistant/components/switch/xiaomi_aqara.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/switch/xiaomi_aqara.py b/homeassistant/components/switch/xiaomi_aqara.py index 2d2ba244ba0..d5502c0b6fa 100644 --- a/homeassistant/components/switch/xiaomi_aqara.py +++ b/homeassistant/components/switch/xiaomi_aqara.py @@ -137,7 +137,7 @@ class XiaomiGenericSwitch(XiaomiDevice, SwitchDevice): self._load_power = round(float(data[LOAD_POWER]), 2) value = data.get(self._data_key) - if value is None: + if value not in ['on', 'off']: return False state = value == 'on'