Skip to content

Commit

Permalink
Fixed logic to check if daytime: was backwards.
Browse files Browse the repository at this point in the history
  • Loading branch information
brhoades committed Dec 19, 2020
1 parent bd1e88f commit d1f74fd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/daemon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ fn get_start_stop_at_date<T: chrono::TimeZone>(

async fn update_monitors_from_time(disps: &mut Displays, cfg: &Config) {
let now = Local::now();
// return _today's_ sunrise and sunset times.
let geo = get_start_stop_at_date(&cfg.geo, now.date());
let is_daytime = now < geo.0 || now > geo.1;
let is_daytime = now > geo.0 && now < geo.1;
info!(
"updating brightness of all displays to {} value",
if is_daytime { "daytime" } else { "nighttime" }
Expand Down

0 comments on commit d1f74fd

Please sign in to comment.