1
0
mirror of https://github.com/s00500/ESPUI.git synced 2024-11-21 22:50:55 +00:00

minor fixes for emulation on host

(https://github.com/d-a-v/emuAsync)
This commit is contained in:
david gauchard 2022-02-02 11:19:43 +01:00
parent 7dcf6a10f4
commit f06781bc03

View File

@ -783,9 +783,9 @@ void ESPUIClass::updateControl(Control* control, int clientId)
root["id"] = control->id;
root["visible"] = control->visible;
root["color"] = (int)control->color;
if (control->panelStyle != 0)
if (control->panelStyle.length())
root["panelStyle"] = control->panelStyle;
if (control->elementStyle != 0)
if (control->elementStyle.length())
root["elementStyle"] = control->elementStyle;
serializeJson(document, json);
@ -811,7 +811,7 @@ void ESPUIClass::updateControl(Control* control, int clientId)
// function like this and it's clients array is private
int tryId = 0;
for (size_t count = 0; count < this->ws->count();)
for (size_t count = 0; tryId < (int)this->ws->count() && count < this->ws->count();)
{
if (this->ws->hasClient(tryId))
{
@ -1003,7 +1003,7 @@ void ESPUIClass::addGraphPoint(uint16_t id, int nValue, int clientId)
// function like this and it's clients array is private
int tryId = 0;
for (size_t count = 0; count < this->ws->count();)
for (size_t count = 0; tryId < (int)this->ws->count() && count < this->ws->count();)
{
if (this->ws->hasClient(tryId))
{
@ -1108,9 +1108,9 @@ void ESPUIClass::prepareJSONChunk(AsyncWebSocketClient* client, uint16_t startin
item["value"] = String(control->value);
item["color"] = (int)control->color;
item["visible"] = (int)control->visible;
if (control->panelStyle != 0)
if (control->panelStyle.length())
item["panelStyle"] = String(control->panelStyle);
if (control->elementStyle != 0)
if (control->elementStyle.length())
item["elementStyle"] = String(control->elementStyle);
if (control->wide == true)
item["wide"] = true;