diff --git a/wled00/data/settings_leds.htm b/wled00/data/settings_leds.htm index b50e8ecb..b01920cf 100644 --- a/wled00/data/settings_leds.htm +++ b/wled00/data/settings_leds.htm @@ -110,8 +110,10 @@ } function enABL() { - var en = gId('able').checked; + const en = gId('able').checked; d.Sf.LA.value = (en) ? laprev:0; + d.Sf.MA.min = (en) ? 250 : 0; // WLEDMM no minimum if invisble + if ((!en) && (!d.Sf.MA.value || d.Sf.MA.value<0)) d.Sf.MA.value = 0; // WLEDMM workaround when field is invisible with invalid value gId('abl').style.display = (en) ? 'inline':'none'; gId('psu2').style.display = (en) ? 'inline':'none'; if (d.Sf.LA.value > 0) setABL(); @@ -173,6 +175,9 @@ gId('fpshelp2').style.display = ((d.Sf.FR.value > 132) && (d.Sf.FR.value < 196)) ? 'block':'none'; // WLEDMM gId('fpshelp3').style.display = (d.Sf.FR.value > 196) ? 'block':'none'; // WLEDMM + const ablEnabled = gId('able').checked; + d.Sf.MA.min = ablEnabled ? 250 : 0; // WLEDMM no minimum if invisble + if ((!ablEnabled) && !d.Sf.MA.value) d.Sf.MA.value = 0; // WLEDMM workaround when field is blank but invisible if (d.Sf.LA.value == 255) laprev = 12; else if (d.Sf.LA.value > 0) laprev = d.Sf.LA.value; diff --git a/wled00/set.cpp b/wled00/set.cpp index 6c9b57c2..91dcf700 100644 --- a/wled00/set.cpp +++ b/wled00/set.cpp @@ -244,8 +244,8 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage) } touchThreshold = request->arg(F("TT")).toInt(); - strip.ablMilliampsMax = request->arg(F("MA")).toInt(); - strip.milliampsPerLed = request->arg(F("LA")).toInt(); + strip.ablMilliampsMax = max(0L, request->arg(F("MA")).toInt()); + strip.milliampsPerLed = max(0L, request->arg(F("LA")).toInt()); briS = request->arg(F("CA")).toInt(); diff --git a/wled00/wled.h b/wled00/wled.h index 9036cde7..6a44ad3c 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -8,7 +8,7 @@ */ // version code in format yymmddb (b = daily build) -#define VERSION 2411070 +#define VERSION 2411080 // WLEDMM - you can check for this define in usermods, to only enabled WLEDMM specific code in the "right" fork. Its not defined in AC WLED. #define _MoonModules_WLED_