From 851d7e22e7382f1890c4a3afa16fa90b4eef78ef Mon Sep 17 00:00:00 2001 From: Rohan Kapoor Date: Mon, 29 Oct 2018 00:07:57 -0700 Subject: [PATCH] Make light.yeelight stop doing IO when accessing properties (#17917) --- homeassistant/components/light/yeelight.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/light/yeelight.py b/homeassistant/components/light/yeelight.py index 1275d854e0b..15f2d24fa8a 100644 --- a/homeassistant/components/light/yeelight.py +++ b/homeassistant/components/light/yeelight.py @@ -276,7 +276,9 @@ class YeelightLight(Light): @property def _properties(self) -> dict: - return self._bulb.last_properties + if self._bulb_device is None: + return {} + return self._bulb_device.last_properties # F821: https://github.com/PyCQA/pyflakes/issues/373 @property