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
1 changed files with 10 additions and 0 deletions

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;