From 7ba25f35260fe6a046c90adbf44fed711a3903dd Mon Sep 17 00:00:00 2001 From: Stefan Jonasson Date: Sun, 11 Dec 2016 09:54:50 +0100 Subject: [PATCH] Fixed crash during light objects initizilation (#4835) * Fixed crash when lights objects was inited --- homeassistant/components/light/tellstick.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/light/tellstick.py b/homeassistant/components/light/tellstick.py index 90add8f012e..d23d5e2c4d6 100644 --- a/homeassistant/components/light/tellstick.py +++ b/homeassistant/components/light/tellstick.py @@ -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