From 6aa0d802ecb2259dbf903b60fb760ec2996b960b Mon Sep 17 00:00:00 2001 From: zwim <36999612+zwim@users.noreply.github.com> Date: Thu, 28 Oct 2021 22:13:41 +0200 Subject: [PATCH] [autowarmth, plugin] Bug if all scheduler entries are deleted (#8386) --- plugins/autowarmth.koplugin/main.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/autowarmth.koplugin/main.lua b/plugins/autowarmth.koplugin/main.lua index d6bb906b2..ce3c6f862 100644 --- a/plugins/autowarmth.koplugin/main.lua +++ b/plugins/autowarmth.koplugin/main.lua @@ -256,7 +256,10 @@ function AutoWarmth:scheduleWarmthChanges(time) end end + UIManager:unschedule(AutoWarmth.setWarmth) -- to be safe, if there are no scheduled entries + if self.activate == 0 then return end + if #self.sched_funcs == 0 then return end -- `actual_warmth` is the value which should be applied now. -- `next_warmth` is valid `delay_time` seconds after now for resume on some devices (KA1)