Fix states not updating after command was sent!

This commit is contained in:
Stefan Jonasson 2015-09-20 21:29:38 +02:00
parent a60a9202a5
commit 34f36479c6
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()