From e9aca78c9c630c8678d82ee403ea9f42dddd4e7b Mon Sep 17 00:00:00 2001 From: Felix Eckhardt Date: Sun, 2 Dec 2018 11:41:45 +0100 Subject: [PATCH] udpateSlider implementation with label was missing --- src/ESPUI.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/ESPUI.cpp b/src/ESPUI.cpp index 7f2c8e9..8e8437a 100644 --- a/src/ESPUI.cpp +++ b/src/ESPUI.cpp @@ -492,6 +492,16 @@ void ESPUIClass::updateSlider(int id, int nValue, int clientId) { } } +void ESPUIClass::updateSlider(String label, int nValue, int clientId) { + if (!labelExists(label)) { + if (DEBUG_ESPUI) + Serial.println("UI ERROR: Element does not " + String(label) + + " exist, cannot update!"); + return; + } + updateSlider(getIdByLabel(label), nValue, clientId); +} + void ESPUIClass::updateSwitcher(int id, bool nValue, int clientId) { if (id < cIndex && controls[id]->type == UI_SWITCHER) { controls[id]->value = nValue ? 1 : 0;