From 26ba593df6c9ed5b46d2e5c4cecaf857b8dd2bb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rolf=20Sch=C3=A4uble?= Date: Tue, 29 Oct 2024 17:48:21 +0100 Subject: [PATCH] Fix heater effect with effect rate set When an effect rate was set, the heater effect did not use the full gradient but only a part of it. --- src/led_effect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/led_effect.py b/src/led_effect.py index 4b340d6..17abc92 100644 --- a/src/led_effect.py +++ b/src/led_effect.py @@ -927,7 +927,7 @@ def nextFrame(self, eventtime): if heaterTarget > 0.0 and heaterCurrent > 0.0: if (heaterCurrent >= self.effectRate): if (heaterCurrent <= heaterTarget-2): - s = int(((heaterCurrent - self.effectRate) / heaterTarget) * 200) + s = int(((heaterCurrent - self.effectRate) / (heaterTarget - self.effectRate)) * 200) s = min(len(self.thisFrame)-1,s) return self.thisFrame[s] elif self.effectCutoff > 0: