Fixed preset loading

This commit is contained in:
cschwinne 2019-02-25 19:14:13 +01:00
parent 600181ed07
commit 587cf751d8
6 changed files with 11 additions and 9 deletions

Binary file not shown.

View File

@ -53,9 +53,9 @@ http:// <input name="CM" maxlength="32"> .local<br>
Try connecting before opening AP for: <input name="AT" type="number" min="0" max="255" required> s <br> Try connecting before opening AP for: <input name="AT" type="number" min="0" max="255" required> s <br>
Client IP: <span class="sip"> Not connected </span><br> Client IP: <span class="sip"> Not connected </span><br>
<h3>Configure Access Point</h3> <h3>Configure Access Point</h3>
AP SSID (leave empty for no AP):<br> <input name="AS" maxlength="32"><br> AP SSID (leave empty for no AP):<br><input name="AS" maxlength="32"><br>
Hide AP name: <input type="checkbox" name="AH"><br> Hide AP name: <input type="checkbox" name="AH"><br>
AP password (leave empty for open):<br> <input type="password" name="AP" maxlength="63"> <br> AP password (leave empty for open):<br> <input type="password" name="AP" maxlength="63"><br>
Access Point WiFi channel: <input name="AC" type="number" min="1" max="13" required><br> Access Point WiFi channel: <input name="AC" type="number" min="1" max="13" required><br>
AP IP: <span class="sip"> Not active </span><hr> AP IP: <span class="sip"> Not active </span><hr>
<button type="button" onclick="B()">Back</button><button type="submit">Save & Reboot</button> <button type="button" onclick="B()">Back</button><button type="submit">Save & Reboot</button>
@ -215,7 +215,7 @@ On/Off button enabled: <input type="checkbox" name="BT"><br>
Infrared receiver enabled: <input type="checkbox" name="IR"><br> Infrared receiver enabled: <input type="checkbox" name="IR"><br>
<a href="https://github.com/Aircoookie/WLED/wiki/Infrared-Control" target="_blank">IR info</a> <a href="https://github.com/Aircoookie/WLED/wiki/Infrared-Control" target="_blank">IR info</a>
<h3>WLED Broadcast</h3> <h3>WLED Broadcast</h3>
UDP Port: <input name="UP" maxlength="5" size="4"><br> UDP Port: <input name="UP" type="number" min="1" max="65535" required><br>
Receive <input type="checkbox" name="RB">Brightness, <input type="checkbox" name="RC">Color, and <input type="checkbox" name="RX">Effects<br> Receive <input type="checkbox" name="RB">Brightness, <input type="checkbox" name="RC">Color, and <input type="checkbox" name="RX">Effects<br>
Send notifications on direct change: <input type="checkbox" name="SD"><br> Send notifications on direct change: <input type="checkbox" name="SD"><br>
Send notifications on button press: <input type="checkbox" name="SB"><br> Send notifications on button press: <input type="checkbox" name="SB"><br>

View File

@ -37,7 +37,6 @@
#include <ESP8266WiFi.h> #include <ESP8266WiFi.h>
#include <ESP8266mDNS.h> #include <ESP8266mDNS.h>
#include <ESPAsyncTCP.h> #include <ESPAsyncTCP.h>
#include <ESPAsyncWebServer.h>
#endif #endif
#include <ESPAsyncWebServer.h> #include <ESPAsyncWebServer.h>
@ -373,10 +372,12 @@ long lastInterfaceUpdate = 0;
byte interfaceUpdateCallMode = 0; byte interfaceUpdateCallMode = 0;
uint32_t mqttFailedConAttempts = 0; uint32_t mqttFailedConAttempts = 0;
#if AUXPIN >= 0
//auxiliary debug pin //auxiliary debug pin
byte auxTime = 0; byte auxTime = 0;
unsigned long auxStartTime = 0; unsigned long auxStartTime = 0;
bool auxActive = false, auxActiveBefore = false; bool auxActive = false, auxActiveBefore = false;
#endif
//alexa udp //alexa udp
String escapedMac; String escapedMac;

View File

@ -562,6 +562,7 @@ bool handleSet(AsyncWebServerRequest *request, String req)
nightlightActiveOld = false; //re-init nightlightActiveOld = false; //re-init
} }
#if AUXPIN >= 0
//toggle general purpose output //toggle general purpose output
pos = req.indexOf("AX="); pos = req.indexOf("AX=");
if (pos > 0) { if (pos > 0) {
@ -569,6 +570,7 @@ bool handleSet(AsyncWebServerRequest *request, String req)
auxActive = true; auxActive = true;
if (auxTime == 0) auxActive = false; if (auxTime == 0) auxActive = false;
} }
#endif
pos = req.indexOf("TT="); pos = req.indexOf("TT=");
if (pos > 0) transitionDelay = getNumVal(&req, pos); if (pos > 0) transitionDelay = getNumVal(&req, pos);
@ -635,7 +637,7 @@ bool handleSet(AsyncWebServerRequest *request, String req)
//apply preset //apply preset
if (updateVal(&req, "PL=", &presetCycCurr, presetCycleMin, presetCycleMax)) { if (updateVal(&req, "PL=", &presetCycCurr, presetCycleMin, presetCycleMax)) {
applyPreset(getNumVal(&req, pos), presetApplyBri, presetApplyCol, presetApplyFx); applyPreset(presetCycCurr, presetApplyBri, presetApplyCol, presetApplyFx);
} }
//cronixie //cronixie

View File

@ -286,7 +286,7 @@ void getJsonInfo()
#else #else
oappend("\"no-ota\"]"); oappend("\"no-ota\"]");
#endif #endif
oappend(",\r\n\"brand\":\"wled\",\r\n\"btype\":\"dev\",\r\n\"mac\":\""); oappend(",\r\n\"brand\":\"wled\",\r\n\"product\":\"DIY light\",\r\n\"btype\":\"dev\",\r\n\"mac\":\"");
oappend((char*)escapedMac.c_str()); oappend((char*)escapedMac.c_str());
oappend("\"\r\n}"); oappend("\"\r\n}");
} }

View File

@ -30,11 +30,10 @@ void setAllLeds() {
} }
if (!enableSecTransition) if (!enableSecTransition)
{ {
for (byte i = 0; i<3; i++) for (byte i = 0; i<4; i++)
{ {
colSecT[i] = colSec[i]; colSecT[i] = colSec[i];
} }
colSecT[3] = colSec[3];
} }
if (useRGBW && autoRGBtoRGBW) if (useRGBW && autoRGBtoRGBW)
{ {