diff --git a/wled00/wled00.ino b/wled00/wled00.ino index 43b66f28..1b15fa7a 100644 --- a/wled00/wled00.ino +++ b/wled00/wled00.ino @@ -33,7 +33,7 @@ #include "WS2812FX.h" //version in format yymmddb (b = daily build) -#define VERSION 1804151 +#define VERSION 1804221 const String versionString = "0.6.4"; //AP and OTA default passwords (change them!) @@ -126,6 +126,8 @@ IPAddress hueIP = (0,0,0,0); bool notifyHue = true; bool hueApplyOnOff = true, hueApplyBri = true, hueApplyColor = true; +uint16_t userVar0 = 0, userVar1 = 0; + //Internal vars byte col[]{0, 0, 0}; byte colOld[]{0, 0, 0}; diff --git a/wled00/wled03_set.ino b/wled00/wled03_set.ino index 966eb8b6..a799b9ca 100644 --- a/wled00/wled03_set.ino +++ b/wled00/wled03_set.ino @@ -817,7 +817,16 @@ bool handleSet(String req) if (overlayCurrent == 4) strip.setCronixieBacklight(cronixieBacklight); overlayRefreshedTime = 0; } - + pos = req.indexOf("U0="); //user var 0 + if (pos > 0) { + userVar0 = req.substring(pos + 3).toInt(); + } + pos = req.indexOf("U1="); //user var 1 + if (pos > 0) { + userVar1 = req.substring(pos + 3).toInt(); + } + //you can add more if you need + //internal call, does not send XML response pos = req.indexOf("IN"); if (pos < 1) XML_response(); diff --git a/wled00/wled05_init.ino b/wled00/wled05_init.ino index 4d1a2278..754a9734 100644 --- a/wled00/wled05_init.ino +++ b/wled00/wled05_init.ino @@ -180,6 +180,10 @@ void wledInit() val += "mA currently"; serveMessage(200,val,"This is just an estimate (does not take into account several factors like effects and wire resistance). It is NOT an accurate measurement!",254); }); + + server.on("/u", HTTP_GET, [](){ + if(!handleFileRead("/user.htm")) serveUserPage(); + }); server.on("/teapot", HTTP_GET, [](){ serveMessage(418, "418. I'm a teapot.","(Tangible Embedded Advanced Project Of Twinkling)",254); diff --git a/wled00/wled06_usermod.ino b/wled00/wled06_usermod.ino index f60d2e4f..0bae45bb 100644 --- a/wled00/wled06_usermod.ino +++ b/wled00/wled06_usermod.ino @@ -19,3 +19,13 @@ void userLoop() } +//USER HTML +const char PAGE_usermod[] PROGMEM = R"=====( +There is no usermod installed or it doesn't specify a custom web page. +)====="; + +void serveUserPage() +{ + server.send(200, PAGE_usermod); +} +