Skip to main content

decide_bedtime

Function decide_bedtime 

Source
pub fn decide_bedtime(
    enabled: bool,
    now_min: u32,
    start_min: u32,
    end_min: u32,
    interval_secs: u64,
    last_sleep_fire: Option<Instant>,
    now: Instant,
) -> BedtimeAction
Expand description

Pure bedtime decision: combine the time-of-day window, the per-window interval, and the last_sleep anchor into one of three actions.

last_sleep == None always fires on the first tick of the window — the cap only kicks in for re-prompts.