[AutoWarmth] Delay front light actions after resume (#12315)

This commit is contained in:
zwim
2024-08-09 19:42:13 +02:00
committed by GitHub
parent 2d2921032d
commit 92de5821bb

View File

@@ -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`