Update on off times

This commit is contained in:
Jean-Loup Beaussart 2025-03-24 22:41:02 +01:00
parent 87cbbdf30f
commit bfb3b23d70
No known key found for this signature in database
GPG Key ID: 582B3C35EAFE46F8

View File

@ -51,10 +51,10 @@ async fn main() -> anyhow::Result<()> {
}
let now = chrono::Local::now().time();
let midnight = chrono::NaiveTime::from_hms_opt(23, 30, 0).unwrap();
let seven_am = chrono::NaiveTime::from_hms_opt(7, 30, 0).unwrap();
let go_to_bed = chrono::NaiveTime::from_hms_opt(23, 0, 0).unwrap();
let wake_up = chrono::NaiveTime::from_hms_opt(9, 0, 0).unwrap();
let mode = if now < midnight && now > seven_am {
let mode = if now < go_to_bed && now > wake_up {
Mode::Displayed
} else {
Mode::Black