Merge pull request #1064 from garyd9/issue-1063

Fix for power on (T=1) resetting brightness.
This commit is contained in:
Aircoookie 2020-07-27 19:21:37 +02:00 committed by GitHub
commit a0d88b0cbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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
}
}