Fix for power on (T=1) resetting brightness.

In particular, if parsing T=1, and the brightness is already non-0,
don't do anything.
Resolves presets set from macros don't restore brightness #1063
This commit is contained in:
garyd9 2020-07-24 23:33:50 -04:00
parent ec6a243e3e
commit 0ca6535345

View File

@ -637,8 +637,8 @@ bool handleSet(AsyncWebServerRequest *request, const String& req)
nightlightActive = false; //always disable nightlight when toggling
switch (getNumVal(&req, pos))
{
case 0: if (bri != 0){briLast = bri; bri = 0;} break; //off
case 1: bri = briLast; break; //on
case 0: if (bri != 0){briLast = bri; bri = 0;} break; //off, only if it was previously on
case 1: if (bri == 0) bri = briLast; break; //on, only if it was previously off
default: toggleOnOff(); //toggle
}
}