From 73b5eb8d9f419ef4c7fb2c66ba68d4c8f3107264 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Sun, 30 Jun 2024 19:32:59 +0200 Subject: [PATCH] Optimize behavior when watering blocked by soil moisture --- src/screens/app_gui.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/screens/app_gui.c b/src/screens/app_gui.c index 910591b..369c07e 100644 --- a/src/screens/app_gui.c +++ b/src/screens/app_gui.c @@ -126,6 +126,11 @@ void gui_loop_iter(GuiEvent message) if (app_config.moisture_enable) { if (s_app.moisture_pt > app_config.moisture_threshold_percent) { // watering not needed + + // Pretend we started the cycle, so we don't get into this loop again and again for the whole minute + s_app.last_cycle_time.hour = s_app.rtc_time.hour; + s_app.last_cycle_time.minute = s_app.rtc_time.minute; + s_app.cycle_time_checking = false; break; } }