1
0
mirror of https://github.com/s00500/ESPUI.git synced 2025-11-27 23:03:16 +00:00

#310 Fix time retrigger loop

Signed-off-by: Lukas Bachschwell <lukas@lbsfilm.at>
This commit is contained in:
2025-11-26 21:31:39 +01:00
parent ed9d7d58a4
commit aed06457b3

View File

@@ -207,6 +207,20 @@ void Control::onWsEvent(String & cmd, String& data)
do // once do // once
{ {
// Serial.println(String(F("Control::onWsEvent"))); // 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()); SetControlChangedId(ESPUI.GetNextControlChangeId());
if (!HasCallback()) if (!HasCallback())
{ {
@@ -317,12 +331,6 @@ void Control::onWsEvent(String & cmd, String& data)
// updateControl(c, client->id()); // updateControl(c, client->id());
SendCallback(S_VALUE); SendCallback(S_VALUE);
} }
else if (cmd.equals(F("time")))
{
value = data;
// updateControl(c, client->id());
SendCallback(TM_VALUE);
}
else else
{ {
#if defined(DEBUG_ESPUI) #if defined(DEBUG_ESPUI)