mirror of
https://github.com/home-assistant/core.git
synced 2025-08-06 06:05:10 +02:00
Fixed crash during light objects initizilation (#4835)
* Fixed crash when lights objects was inited
This commit is contained in:
@@ -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