From d1f74fdb31ad5514283273986eef924649d8755f Mon Sep 17 00:00:00 2001 From: Billy J Rhoades II Date: Sat, 19 Dec 2020 14:59:25 -0800 Subject: [PATCH] Fixed logic to check if daytime: was backwards. --- src/daemon.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/daemon.rs b/src/daemon.rs index c49e2c1..4b41b15 100644 --- a/src/daemon.rs +++ b/src/daemon.rs @@ -79,8 +79,9 @@ fn get_start_stop_at_date( 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" }