From ed12f9e23794d9ba9269f0db2d1bcd06c6fd47ae Mon Sep 17 00:00:00 2001 From: Stefan Jonasson Date: Sat, 21 Jan 2017 21:24:48 +0100 Subject: [PATCH] Tellstick light fix (#5482) * Fixed crash when lights objects was inited * Fixed initial value for tellstick lights * Fixed problem with lights not working with the turn_on action. --- homeassistant/components/light/tellstick.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/light/tellstick.py b/homeassistant/components/light/tellstick.py index ea908fda02f..9002731e44e 100644 --- a/homeassistant/components/light/tellstick.py +++ b/homeassistant/components/light/tellstick.py @@ -83,7 +83,9 @@ class TellstickLight(TellstickDevice, Light): def _send_device_command(self, requested_state, requested_data): """Let tellcore update the actual device to the requested state.""" if requested_state: - brightness = requested_data - self._tellcore_device.dim(brightness) + if requested_data is not None: + self._brightness = int(requested_data) + + self._tellcore_device.dim(self._brightness) else: self._tellcore_device.turn_off()