Web UI improvements, better frontlight functionality

This commit is contained in:
Djuri 2024-06-08 01:00:52 +02:00
parent 32e40e2cb7
commit 9ede0f4dc3
7 changed files with 477 additions and 211 deletions

View file

@ -67,6 +67,14 @@ void setup()
setupOTA();
waitUntilNoneBusy();
#ifdef HAS_FRONTLIGHT
if (!preferences.getBool("flAlwaysOn", false)) {
frontlightFadeOutAll(preferences.getUInt("flEffectDelay"), true);
flArray.allOFF();
}
#endif
forceFullRefresh();
}
@ -712,15 +720,17 @@ void setupFrontlight()
{
preferences.putUInt("flMaxBrightness", 2048);
}
if (preferences.getBool("flAlwaysOn", false)) {
Serial.println(F("FL Always on"));
frontlightFadeInAll();
} else {
Serial.println(F("FL all off"));
flArray.allOFF();
if (!preferences.isKey("flEffectDelay"))
{
preferences.putUInt("flEffectDelay", 5);
}
if (!preferences.isKey("flFlashOnUpd"))
{
preferences.putBool("flFlashOnUpd", false);
}
frontlightFadeInAll(preferences.getUInt("flEffectDelay"), true);
}
#endif