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.
This commit is contained in:
Stefan Jonasson 2017-01-21 21:24:48 +01:00 committed by Paulus Schoutsen
parent 13d801e1c6
commit ed12f9e237

View file

@ -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()