mirror of
https://github.com/s00500/ESPUI.git
synced 2024-11-24 07:20:53 +00:00
feat: implemented clearGraph function
This commit is contained in:
parent
48594de29a
commit
f35d3a19d4
@ -1031,7 +1031,26 @@ void ESPUIClass::updateTime(uint16_t id, int clientId)
|
|||||||
updateControl(id, clientId);
|
updateControl(id, clientId);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ESPUIClass::clearGraph(uint16_t id, int clientId) { }
|
void ESPUIClass::clearGraph(uint16_t id, int clientId) {
|
||||||
|
do // once
|
||||||
|
{
|
||||||
|
Control* control = getControl(id);
|
||||||
|
if (!control)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
DynamicJsonDocument document(jsonUpdateDocumentSize);
|
||||||
|
JsonObject root = document.to<JsonObject>();
|
||||||
|
|
||||||
|
root[F("type")] = 109;
|
||||||
|
root[F("value")] = 0;
|
||||||
|
root[F("id")] = control->id;
|
||||||
|
|
||||||
|
SendJsonDocToWebSocket(document, clientId);
|
||||||
|
|
||||||
|
} while(false);
|
||||||
|
}
|
||||||
|
|
||||||
void ESPUIClass::addGraphPoint(uint16_t id, int nValue, int clientId)
|
void ESPUIClass::addGraphPoint(uint16_t id, int nValue, int clientId)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user