From cda1a573d69bc1677e0ae372370ddee22cd4010e Mon Sep 17 00:00:00 2001 From: Lukas Bachschwell Date: Wed, 26 Aug 2020 22:00:20 +0200 Subject: [PATCH] cleanup Signed-off-by: Lukas Bachschwell --- src/ESPUI.cpp | 11 +++++------ src/ESPUI.h | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/ESPUI.cpp b/src/ESPUI.cpp index 9e6db7e..858d291 100644 --- a/src/ESPUI.cpp +++ b/src/ESPUI.cpp @@ -563,7 +563,7 @@ bool ESPUIClass::removeControl(uint16_t id, bool force_reload_ui) } else { - jsonDom(); + jsonDom(); // resends to all } return true; } @@ -670,6 +670,10 @@ void ESPUIClass::updateControl(Control *control, int clientId) if (clientId < 0) { + if (this->verbosity >= Verbosity::VerboseJSON) + { + Serial.println("TextAll"); + } this->ws->textAll(json); return; } @@ -684,11 +688,6 @@ void ESPUIClass::updateControl(Control *control, int clientId) if (clientId != tryId) { this->ws->client(tryId)->text(json); - - if (this->verbosity >= Verbosity::VerboseJSON) - { - Serial.println(json); - } } count++; diff --git a/src/ESPUI.h b/src/ESPUI.h index b00116c..a491330 100644 --- a/src/ESPUI.h +++ b/src/ESPUI.h @@ -256,7 +256,7 @@ public: const char *ui_title = "ESPUI"; // Store UI Title and Header Name Control *controls = nullptr; void jsonReload(); - void jsonDom(AsyncWebSocketClient *client); + void jsonDom(AsyncWebSocketClient *client = nullptr); Verbosity verbosity;