Fixed crash during light objects initizilation (#4835)
* Fixed crash when lights objects was inited
This commit is contained in:
1 parent
ee5b9e7291
commit
7ba25f3526
1 file changed
+5
-1
@@ -72,7 +72,11 @@ class TellstickLight(TellstickDevice, Light):
|
||||
if brightness is not None:
|
||||
self._brightness = brightness
|
||||
|
||||
self._state = (self._brightness > 0)
|
||||
# _brightness is not defined when called from super
|
||||
try:
|
||||
self._state = (self._brightness > 0)
|
||||
except AttributeError:
|
||||
self._state = True
|
||||
else:
|
||||
self._state = False
|
||||
|
||||
|
||||
Reference in new issue
Block a user