aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-08-23 21:10:29 +0200
committerlonkaars <loek@pipeframe.xyz>2022-08-23 21:10:29 +0200
commit03f1032bfe34c659cc78c805a6fb5b0da987fc35 (patch)
tree98ce4aa89c4a9a236d91f821e204b175313a4852
parent583358de43f241a0f91dbc4ad0122324880080b9 (diff)
forgot to cancel transition
-rw-r--r--light.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/light.py b/light.py
index 330a13d..f4f92a1 100644
--- a/light.py
+++ b/light.py
@@ -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