Fix: Xiaomi Plug state is set twice (#17482)

* Xiaomi Plug UI fix #17422

* Review
This commit is contained in:
Nikolay Vasilchuk 2018-10-18 21:28:43 +03:00 committed by Teemu R
parent 7eb6e49df7
commit 6239a523cc

View File

@ -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'