[plugin] AutoDim: reschedule on every tap (#9243)

This is a maintenance PR.
With scheduling the next autodim_check on every tap, we can keep the device longer in standby mode. So we have more power savings.

The long story: The current version works like that:
Let's say I set the idle-time to 3 min and I need 2.5 min to read a page.
Start at 0 min (next scheduled check is at/in 3 min)
Read and tap to turn page after 2.5 min (next scheduled check is at 3 min - in 0.5 min)
At 3 min there is a scheduled_check (wakeup) -> reschedule check in 3 min.
Read and tap to turn page after 2.5 min (no wakeup)
Then after 1 min there is a wakeup -> reschedule.
---> So I get an additional wakeup on every second page.

This PR solves the problem: During normal reading I don't get any wakeup during reading. (The only drawback is, that one function is unscheduled/scheduled on every tap, but that is no big deal).
pull/9245/head v2022.06
zwim 2 years ago committed by GitHub
parent 4f4b1e523a
commit 6fdb83017b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -173,6 +173,9 @@ end
function AutoDim:onInputEvent()
self.last_action_time = UIManager:getElapsedTimeSinceBoot()
-- Make sure the next scheduled autodim check is as much in the future
-- as possible, to reduce wakes from standby.
self:_schedule_autodim_task()
end
function AutoDim:_unschedule_autodim_task()

Loading…
Cancel
Save