Update on off times
This commit is contained in:
parent
87cbbdf30f
commit
bfb3b23d70
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user