1
0
mirror of https://github.com/s00500/ESPUI.git synced 2025-06-14 02:30:41 +00:00

Merge branch 'master' into enabledisable

This commit is contained in:
Ian Gray
2022-02-11 19:57:36 +00:00
committed by GitHub
2 changed files with 17 additions and 6 deletions

View File

@ -784,9 +784,9 @@ void ESPUIClass::updateControl(Control* control, int clientId)
root["visible"] = control->visible;
root["color"] = (int)control->color;
root["enabled"] = control->enabled;
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);
@ -812,7 +812,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))
{
@ -1014,7 +1014,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))
{
@ -1120,9 +1120,9 @@ void ESPUIClass::prepareJSONChunk(AsyncWebSocketClient* client, uint16_t startin
item["color"] = (int)control->color;
item["visible"] = (int)control->visible;
item["enabled"] = control->enabled;
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;