diff --git a/src/relay_loop.rs b/src/relay_loop.rs index 9f1846a..753dfba 100644 --- a/src/relay_loop.rs +++ b/src/relay_loop.rs @@ -36,11 +36,6 @@ async fn run_relays(app_state: &Addr) -> Result<(), EmgauwaError> { loop { let now = EmgauwaNow::now(); - log::debug!( - "Relay loop at {}: {}", - now.time, - printable_relay_states(&this.get_relay_states()) - ); let notifier_future = notifier.notified(); pin_mut!(notifier_future); @@ -51,6 +46,8 @@ async fn run_relays(app_state: &Addr) -> Result<(), EmgauwaError> { .await .is_ok(); + let now = EmgauwaNow::now(); + check_weekday(app_state, &mut last_weekday, &mut changed, &now).await?; if changed { @@ -58,6 +55,12 @@ async fn run_relays(app_state: &Addr) -> Result<(), EmgauwaError> { this = utils::app_state_get_this(app_state).await?; } + log::debug!( + "Relay loop at {}: {}", + now.time, + printable_relay_states(&this.get_relay_states()) + ); + duration_override = this .relays .iter_mut()