From aed06457b3856215d5c33cab98b25611500e34bd Mon Sep 17 00:00:00 2001 From: Lukas Bachschwell Date: Wed, 26 Nov 2025 21:31:39 +0100 Subject: [PATCH] #310 Fix time retrigger loop Signed-off-by: Lukas Bachschwell --- src/ESPUIcontrol.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/ESPUIcontrol.cpp b/src/ESPUIcontrol.cpp index 36647bf..41e3157 100644 --- a/src/ESPUIcontrol.cpp +++ b/src/ESPUIcontrol.cpp @@ -207,6 +207,20 @@ void Control::onWsEvent(String & cmd, String& data) do // once { // Serial.println(String(F("Control::onWsEvent"))); + + // Handle time response separately - it should not mark the control as changed + // because it's a one-shot response to an updateTime() request, not a state change + // that needs to be broadcast to other clients + if (cmd.equals(F("time"))) + { + if (HasCallback()) + { + value = data; + SendCallback(TM_VALUE); + } + break; + } + SetControlChangedId(ESPUI.GetNextControlChangeId()); if (!HasCallback()) { @@ -317,12 +331,6 @@ void Control::onWsEvent(String & cmd, String& data) // updateControl(c, client->id()); SendCallback(S_VALUE); } - else if (cmd.equals(F("time"))) - { - value = data; - // updateControl(c, client->id()); - SendCallback(TM_VALUE); - } else { #if defined(DEBUG_ESPUI)