Skip to content

Commit

Permalink
Set display brightness from WebUI
Browse files Browse the repository at this point in the history
  • Loading branch information
steadramon committed Jan 10, 2025
1 parent 3770495 commit cffc2b7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ESPGeiger/src/ConfigManager/ConfigManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ static WiFiManagerParameter ESPGeigerParams[] =
#if defined(SSD1306_DISPLAY) && defined(GEIGER_PUSHBUTTON)
WiFiManagerParameter("dispTimeout", "Display timeout (s)", "120", 6, "required type='number' min='0' max='99999'"),
#endif
#if defined(SSD1306_DISPLAY)
WiFiManagerParameter("dispBrightness", "Display brightness", "64", 4, "required type='number' min='0' max='255'"),
#endif
#ifdef GEIGER_NEOPIXEL
WiFiManagerParameter("neopixelBrightness", "NeoPixel Brightness", "15", 4, "required type='number' min='0' max='100'"),
#endif
Expand Down Expand Up @@ -310,6 +313,13 @@ void ConfigManager::setExternals() {
}
display.setTimeout(atoi(cfgvar));
#endif
#if defined(SSD1306_DISPLAY)
cfgvar = ConfigManager::getParamValueFromID("dispBrightness");
if (cfgvar == NULL) {
cfgvar = "64";
}
display.setBrightness(atoi(cfgvar));
#endif
#ifdef GEIGER_NEOPIXEL
cfgvar = ConfigManager::getParamValueFromID("neopixelBrightness");
if (cfgvar == NULL) {
Expand Down

0 comments on commit cffc2b7

Please sign in to comment.