From 03f1032bfe34c659cc78c805a6fb5b0da987fc35 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Tue, 23 Aug 2022 21:10:29 +0200 Subject: forgot to cancel transition --- light.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3