Merge pull request #416 from stefan-jonasson/dev

Fix states not updating after command was sent!
pull/435/head
stefan-jonasson 2015-09-20 22:00:12 +02:00
commit f0991d63d1
2 changed files with 4 additions and 0 deletions

View File

@ -80,6 +80,7 @@ class TellstickLight(Light):
""" Turns the switch off. """
self.tellstick_device.turn_off()
self._brightness = 0
self.update_ha_state()
def turn_on(self, **kwargs):
""" Turns the switch on. """
@ -91,6 +92,7 @@ class TellstickLight(Light):
self._brightness = brightness
self.tellstick_device.dim(self._brightness)
self.update_ha_state()
def update(self):
""" Update state of the light. """

View File

@ -97,8 +97,10 @@ class TellstickSwitchDevice(ToggleEntity):
""" Turns the switch on. """
for _ in range(self.signal_repetitions):
self.tellstick_device.turn_on()
self.update_ha_state()
def turn_off(self, **kwargs):
""" Turns the switch off. """
for _ in range(self.signal_repetitions):
self.tellstick_device.turn_off()
self.update_ha_state()