mirror of
https://github.com/koreader/koreader
synced 2024-11-10 01:10:34 +00:00
[AutoWarmth] Delay front light actions after resume (#12315)
This commit is contained in:
parent
2d2921032d
commit
92de5821bb
@ -428,14 +428,16 @@ function AutoWarmth:setFrontlight(enable, keep_user_toggle)
|
||||
return
|
||||
end
|
||||
|
||||
if enable then
|
||||
Powerd:turnOnFrontlight()
|
||||
AutoWarmth.fl_turned_off = false
|
||||
else
|
||||
Powerd:turnOffFrontlight()
|
||||
AutoWarmth.fl_turned_off = true
|
||||
UIManager:broadcastEvent(Event:new("FrontlightTurnedOff")) -- used e.g. in AutoDim
|
||||
end
|
||||
UIManager:scheduleIn(0.01, function()
|
||||
if enable then
|
||||
Powerd:turnOnFrontlight()
|
||||
AutoWarmth.fl_turned_off = false
|
||||
else
|
||||
Powerd:turnOffFrontlight()
|
||||
AutoWarmth.fl_turned_off = true
|
||||
UIManager:broadcastEvent(Event:new("FrontlightTurnedOff")) -- used e.g. in AutoDim
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
-- toggles Frontlight on or off, depending on `now_s`
|
||||
|
Loading…
Reference in New Issue
Block a user