diff options
author | lonkaars <loek@pipeframe.xyz> | 2022-08-23 21:10:29 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2022-08-23 21:10:29 +0200 |
commit | 03f1032bfe34c659cc78c805a6fb5b0da987fc35 (patch) | |
tree | 98ce4aa89c4a9a236d91f821e204b175313a4852 | |
parent | 583358de43f241a0f91dbc4ad0122324880080b9 (diff) |
forgot to cancel transition
-rw-r--r-- | light.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -94,6 +94,7 @@ class BekenLight(LightEntity): transition = kwargs.get(ATTR_TRANSITION) if transition != None: + self._transitioning = False self.interpolate(brightness_old if on_old else 0, self._brightness, rgb_old if on_old else (0, 0, 0,), self._rgb, w_old if on_old else 0, self._w, transition) self.update_beken_lamp() @@ -103,9 +104,9 @@ class BekenLight(LightEntity): self.update_beken_lamp() def interpolate(self, brightness_old, brightness, rgb_old, rgb, w_old, w, transition): - self._transitioning = True thread = Thread(target=self.interpolate_thread, args=(brightness_old, brightness, rgb_old, rgb, w_old, w, transition, )) thread.start() + self._transitioning = True def interpolate_thread(self, brightness_old, brightness, rgb_old, rgb, w_old, w, transition): step_duration = 0.250 |