Make light.yeelight stop doing IO when accessing properties (#17917)
This commit is contained in:
1 parent
e5c97fdcab
commit
851d7e22e7
1 file changed
+3
-1
@@ -276,7 +276,9 @@ class YeelightLight(Light):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def _properties(self) -> dict:
|
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
|
# F821: https://github.com/PyCQA/pyflakes/issues/373
|
||||||
@property
|
@property
|
||||||
|
|||||||
Reference in new issue
Block a user