1
0
mirror of https://github.com/s00500/ESPUI.git synced 2024-12-23 00:40:49 +00:00

Merge pull request #42 from don41382/patch-2

udpateSlider implementation with label was missing
This commit is contained in:
Lukas Bachschwell 2018-12-02 14:22:43 +01:00 committed by GitHub
commit 980e20818f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;