mirror of
https://github.com/s00500/ESPUI.git
synced 2026-02-05 22:12:40 +00:00
Merge branch 'time-retrigger'
This commit is contained in:
@@ -208,6 +208,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())
|
||||||
{
|
{
|
||||||
@@ -318,12 +332,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)
|
||||||
|
|||||||
Reference in New Issue
Block a user