From b872191dc96fa9ee061ec20d3435b31772176593 Mon Sep 17 00:00:00 2001 From: Max Ignatenko Date: Wed, 17 Apr 2024 18:23:12 +0100 Subject: [PATCH] Stop touching night mode when control_nightmode == false (#11685) This is a regression introduced in #10762 --- plugins/autowarmth.koplugin/main.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/autowarmth.koplugin/main.lua b/plugins/autowarmth.koplugin/main.lua index 4ca278d71..f79625614 100644 --- a/plugins/autowarmth.koplugin/main.lua +++ b/plugins/autowarmth.koplugin/main.lua @@ -512,7 +512,9 @@ function AutoWarmth:setWarmth(val, force_warmth) -- A value > 100 means to set night mode and set warmth to maximum. -- We use an offset of 1000 to "flag", that night mode is on. if val then - DeviceListener:onSetNightMode(self.control_nightmode and val > 100) + if self.control_nightmode then + DeviceListener:onSetNightMode(val > 100) + end if self.control_warmth and Device:hasNaturalLight() then val = math.min(val, 100) -- "mask" night mode