From 1b17ce8ba016c8d027d0c19d589f26e576a27a8b Mon Sep 17 00:00:00 2001 From: Frans de Jonge Date: Sun, 1 Sep 2019 21:25:32 +0200 Subject: [PATCH] [fix, Kobo] Save frontlight state on shutdown after suspend (#5305) Fixes . --- frontend/device/kobo/powerd.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/device/kobo/powerd.lua b/frontend/device/kobo/powerd.lua index 4cccc9c07..c91f736f7 100644 --- a/frontend/device/kobo/powerd.lua +++ b/frontend/device/kobo/powerd.lua @@ -166,7 +166,9 @@ function KoboPowerD:saveSettings() -- that if frontlight was toggled off, we save and restore the previous -- untoggled intensity and toggle state at next startup) local cur_intensity = self.fl_intensity - local cur_is_fl_on = self.is_fl_on + -- If we're shutting down straight from suspend then the frontlight won't + -- be turned on but we still want to save its state. + local cur_is_fl_on = self.is_fl_on or self.fl_was_on local cur_warmth = self.fl_warmth local cur_auto_warmth = self.auto_warmth local cur_max_warmth_hour = self.max_warmth_hour