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

udpateSlider implementation with label was missing

This commit is contained in:
Felix Eckhardt 2018-12-02 11:41:45 +01:00 committed by GitHub
parent a56f5decc7
commit e9aca78c9c
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;