From ba19e2083353600f94521c8c3a4fb7f4d1473f37 Mon Sep 17 00:00:00 2001 From: cschwinne Date: Tue, 19 Feb 2019 12:57:50 +0100 Subject: [PATCH] Added Macro notification option Removed realtime UI lock --- wled00/data/settings_sync.htm | Bin 11136 -> 11092 bytes wled00/html_settings.h | 10 +++++----- wled00/wled00.ino | 5 ++--- wled00/wled01_eeprom.ino | 4 ++-- wled00/wled02_xml.ino | 23 +++++++++++++++++++++-- wled00/wled03_set.ino | 6 +++--- wled00/wled18_server.ino | 33 --------------------------------- 7 files changed, 33 insertions(+), 48 deletions(-) diff --git a/wled00/data/settings_sync.htm b/wled00/data/settings_sync.htm index bd9074650a4d31df88ce01ed908ad80310678ae5..7f8aee8f8243d867fc669320a018fcfb93acfe71 100644 GIT binary patch delta 82 zcmZn&zY@0Lm5{Uo0|W*$q%!0&qyTxo42cZM3`Gq2lWz;gPF^4)w)vgVA=b$$!UCIX cBp)#f=K|#`f$B0Dav2K1YD+d}ON$Bs0IInbGXMYp delta 142 zcmcZ-))2nomC)o5qAZj31l2ar6Q095nN3YV*OeiUA(0`8A%`KAL4hHZ!4pU(G9&|G zDnl_4Dlnullrj`CWCGQtPc{_^)(&M*Vz2{>YXH?G0!0
Send notifications on button press:
Send Alexa notifications:
Send Philips Hue change notifications:
-Send notifications twice:
+Send Macro notifications:
+Send notifications twice:

Realtime

Receive UDP realtime:

E1.31 (sACN)
@@ -231,14 +232,13 @@ E1.31 start universe: ms
Force max brightness:
Disable realtime gamma correction:
-Realtime LED offset:
-Enable UI access during realtime: (can cause issues) +Realtime LED offset:

Alexa Voice Assistant

Emulate Alexa device:
Alexa invocation name:

Blynk

Blynk, MQTT and Hue sync all connect to external hosts!
-This impacts the responsiveness of the ESP8266.

+This may impact the responsiveness of the ESP8266.
For best results, only use one of these services at a time.
(alternatively, connect a second ESP to them and use the UDP sync)

Device Auth token:
@@ -385,7 +385,7 @@ HTTP traffic is unencrypted. An attacker in the same network can intercept form
Enable ArduinoOTA:

About

-WLED version 0.8.3

+WLED version 0.8.4-dev

Contributors, dependencies and special thanks
A huge thank you to everyone who helped me create WLED!

(c) 2016-2019 Christian Schwinne
diff --git a/wled00/wled00.ino b/wled00/wled00.ino index 7c5c0fe25..69980cbfe 100644 --- a/wled00/wled00.ino +++ b/wled00/wled00.ino @@ -3,7 +3,7 @@ */ /* * @title WLED project sketch - * @version 0.8.3 + * @version 0.8.4-dev * @author Christian Schwinne */ @@ -80,7 +80,7 @@ //version code in format yymmddb (b = daily build) -#define VERSION 1902181 +#define VERSION 1902191 char versionString[] = "0.8.4-dev"; @@ -182,7 +182,6 @@ char blynkApiKey[36] = ""; //Auth token for Blynk server. If uint16_t realtimeTimeoutMs = 2500; //ms timeout of realtime mode before returning to normal mode int arlsOffset = 0; //realtime LED offset bool receiveDirect = true; //receive UDP realtime -bool enableRealtimeUI = false; //web UI accessible during realtime mode (works on ESP32, lags out ESP8266) bool arlsDisableGammaCorrection = true; //activate if gamma correction is handled by the source bool arlsForceMaxBri = false; //enable to force max brightness if source has very dark colors that would be black diff --git a/wled00/wled01_eeprom.ino b/wled00/wled01_eeprom.ino index 1847ac844..2cf55b926 100644 --- a/wled00/wled01_eeprom.ino +++ b/wled00/wled01_eeprom.ino @@ -224,7 +224,7 @@ void saveSettingsToEEPROM() EEPROM.write(2196, arlsDisableGammaCorrection); EEPROM.write(2200, !receiveDirect); - EEPROM.write(2201, enableRealtimeUI); + EEPROM.write(2201, notifyMacro); //was enableRealtime EEPROM.write(2202, uiConfiguration); EEPROM.write(2203, autoRGBtoRGBW); EEPROM.write(2204, skipFirstLed); @@ -469,7 +469,7 @@ void loadSettingsFromEEPROM(bool first) } receiveDirect = !EEPROM.read(2200); - enableRealtimeUI = EEPROM.read(2201); + notifyMacro = EEPROM.read(2201); uiConfiguration = EEPROM.read(2202); #ifdef WLED_DISABLE_MOBILE_UI diff --git a/wled00/wled02_xml.ino b/wled00/wled02_xml.ino index 6c8689bf0..3653eb6ba 100644 --- a/wled00/wled02_xml.ino +++ b/wled00/wled02_xml.ino @@ -56,7 +56,26 @@ void XML_response(AsyncWebServerRequest *request, bool includeTheme) oappend(""); oappendi(presetCyclingEnabled); oappend(""); - oappend(serverDescription); + if (realtimeActive) + { + String mesg = "Live "; + if (realtimeIP[0] == 0) + { + mesg += "E1.31 mode"; + } else { + mesg += "UDP from "; + mesg += realtimeIP[0]; + for (int i = 1; i < 4; i++) + { + mesg += "."; + mesg += realtimeIP[i]; + } + } + oappend((char*)mesg.c_str()); + } else { + oappend(serverDescription); + } + oappend(""); if (includeTheme) { @@ -268,6 +287,7 @@ void getSettingsJS(byte subPage) sappend('c',"SD",notifyDirectDefault); sappend('c',"SB",notifyButton); sappend('c',"SH",notifyHue); + sappend('c',"SM",notifyMacro); sappend('c',"S2",notifyTwice); sappend('c',"RD",receiveDirect); sappend('c',"EM",e131Multicast); @@ -276,7 +296,6 @@ void getSettingsJS(byte subPage) sappend('c',"FB",arlsForceMaxBri); sappend('c',"RG",arlsDisableGammaCorrection); sappend('v',"WO",arlsOffset); - sappend('c',"RU",enableRealtimeUI); sappend('c',"AL",alexaEnabled); sappends('s',"AI",alexaInvocationName); sappend('c',"SA",notifyAlexa); diff --git a/wled00/wled03_set.ino b/wled00/wled03_set.ino index 0ec1a6060..33e12ab7a 100644 --- a/wled00/wled03_set.ino +++ b/wled00/wled03_set.ino @@ -152,6 +152,9 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage) notifyDirectDefault = request->hasArg("SD"); notifyDirect = notifyDirectDefault; notifyButton = request->hasArg("SB"); + notifyAlexa = request->hasArg("SA"); + notifyHue = request->hasArg("SH"); + notifyMacro = request->hasArg("SM"); notifyTwice = request->hasArg("S2"); receiveDirect = request->hasArg("RD"); @@ -164,11 +167,9 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage) arlsDisableGammaCorrection = request->hasArg("RG"); t = request->arg("WO").toInt(); if (t >= -255 && t <= 255) arlsOffset = t; - enableRealtimeUI = request->hasArg("RU"); alexaEnabled = request->hasArg("AL"); strcpy(alexaInvocationName, request->arg("AI").c_str()); - notifyAlexa = request->hasArg("SA"); if (request->hasArg("BK") && !request->arg("BK").equals("Hidden")) { strcpy(blynkApiKey,request->arg("BK").c_str()); initBlynk(blynkApiKey); @@ -178,7 +179,6 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage) strcpy(mqttDeviceTopic, request->arg("MD").c_str()); strcpy(mqttGroupTopic, request->arg("MG").c_str()); - notifyHue = request->hasArg("SH"); for (int i=0;i<4;i++){ String a = "H"+String(i); hueIP[i] = request->arg(a).toInt(); diff --git a/wled00/wled18_server.ino b/wled00/wled18_server.ino index 096b02ca6..f6418adb9 100644 --- a/wled00/wled18_server.ino +++ b/wled00/wled18_server.ino @@ -211,27 +211,6 @@ void serveIndexOrWelcome(AsyncWebServerRequest *request) } } -void serveRealtimeError(AsyncWebServerRequest *request, bool settings) -{ - String mesg = "The "; - mesg += (settings)?"settings":"WLED"; - mesg += " UI is not available while receiving real-time data ("; - if (realtimeIP[0] == 0) - { - mesg += "E1.31"; - } else { - mesg += "UDP from "; - mesg += realtimeIP[0]; - for (int i = 1; i < 4; i++) - { - mesg += "."; - mesg += realtimeIP[i]; - } - } - mesg += ")."; - request->send(200, "text/plain", mesg); -} - void getCSSColors() { @@ -250,12 +229,6 @@ void getCSSColors() void serveIndex(AsyncWebServerRequest* request) { - if (realtimeActive && !enableRealtimeUI) //do not serve while receiving realtime - { - serveRealtimeError(request, false); - return; - } - bool serveMobile = false; if (uiConfiguration == 0 && request->hasHeader("User-Agent")) serveMobile = checkClientIsMobile(request->getHeader("User-Agent")->value()); else if (uiConfiguration == 2) serveMobile = true; @@ -339,12 +312,6 @@ void serveSettings(AsyncWebServerRequest* request) else if (url.indexOf("time") > 0) subPage = 5; else if (url.indexOf("sec") > 0) subPage = 6; } else subPage = 255; //welcome page - - if (realtimeActive && !enableRealtimeUI) //do not serve while receiving realtime - { - serveRealtimeError(request, true); - return; - } if (subPage == 1 && wifiLock && otaLock) {