diff --git a/wled00/FX_fcn.cpp b/wled00/FX_fcn.cpp index bebf599de..e0218e097 100644 --- a/wled00/FX_fcn.cpp +++ b/wled00/FX_fcn.cpp @@ -743,12 +743,6 @@ void WS2812FX::makeAutoSegments(bool forceReset) { //expand the main seg to the entire length, but only if there are no other segments, or reset is forced uint8_t mainSeg = getMainSegmentId(); - if (forceReset) { - for (uint8_t i = 0; i < MAX_NUM_SEGMENTS; i++) { - setSegment(i, 0, 0); - } - } - if (forceReset) { for (uint8_t i = 0; i < MAX_NUM_SEGMENTS; i++) { setSegment(i, 0, 0); diff --git a/wled00/cfg.cpp b/wled00/cfg.cpp index 382a283d1..6f043b5eb 100644 --- a/wled00/cfg.cpp +++ b/wled00/cfg.cpp @@ -31,7 +31,7 @@ bool deserializeConfig(JsonObject doc, bool fromFS) { getStringFromJson(cmDNS, id[F("mdns")], 33); getStringFromJson(serverDescription, id[F("name")], 33); getStringFromJson(alexaInvocationName, id[F("inv")], 33); -#ifndef WLED_DISABLE_SIMPLE_UI +#ifdef WLED_ENABLE_SIMPLE_UI CJSON(simplifiedUI, id[F("sui")]); #endif @@ -509,7 +509,9 @@ void serializeConfig() { id[F("mdns")] = cmDNS; id[F("name")] = serverDescription; id[F("inv")] = alexaInvocationName; +#ifdef WLED_ENABLE_SIMPLE_UI id[F("sui")] = simplifiedUI; +#endif JsonObject nw = doc.createNestedObject("nw"); diff --git a/wled00/set.cpp b/wled00/set.cpp index 4689ad90f..75318bce6 100644 --- a/wled00/set.cpp +++ b/wled00/set.cpp @@ -205,7 +205,7 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage) { strlcpy(serverDescription, request->arg(F("DS")).c_str(), 33); syncToggleReceive = request->hasArg(F("ST")); - #ifndef WLED_DISABLE_SIMPLE_UI + #ifdef WLED_ENABLE_SIMPLE_UI if (simplifiedUI ^ request->hasArg(F("SU"))) { // UI selection changed, invalidate browser cache cacheInvalidate++; diff --git a/wled00/wled.h b/wled00/wled.h index 21101ad75..509a0e00d 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -8,7 +8,7 @@ */ // version code in format yymmddb (b = daily build) -#define VERSION 2203282 +#define VERSION 2203310 //uncomment this if you have a "my_config.h" file you'd like to use //#define WLED_USE_MY_CONFIG @@ -143,7 +143,7 @@ using PSRAMDynamicJsonDocument = BasicJsonDocument; #include "fcn_declare.h" #include "html_ui.h" -#ifndef WLED_DISABLE_SIMPLE_UI +#ifdef WLED_ENABLE_SIMPLE_UI #include "html_simple.h" #endif #include "html_settings.h" @@ -461,13 +461,12 @@ WLED_GLOBAL byte colNlT[] _INIT_N(({ 0, 0, 0, 0 })); // current nightligh // brightness WLED_GLOBAL unsigned long lastOnTime _INIT(0); -WLED_GLOBAL bool offMode _INIT(!turnOnAtBoot); -WLED_GLOBAL byte bri _INIT(briS); -WLED_GLOBAL byte briOld _INIT(0); -WLED_GLOBAL byte briT _INIT(0); -WLED_GLOBAL byte briIT _INIT(0); -WLED_GLOBAL byte briLast _INIT(128); // brightness before turned off. Used for toggle function -WLED_GLOBAL byte whiteLast _INIT(128); // white channel before turned off. Used for toggle function +WLED_GLOBAL bool offMode _INIT(!turnOnAtBoot); +WLED_GLOBAL byte bri _INIT(briS); // global brightness (set) +WLED_GLOBAL byte briOld _INIT(0); // global brightnes while in transition loop (previous iteration) +WLED_GLOBAL byte briT _INIT(0); // global brightness during transition +WLED_GLOBAL byte briLast _INIT(128); // brightness before turned off. Used for toggle function +WLED_GLOBAL byte whiteLast _INIT(128); // white channel before turned off. Used for toggle function // button WLED_GLOBAL bool buttonPublishMqtt _INIT(false); diff --git a/wled00/wled_server.cpp b/wled00/wled_server.cpp index 1e6fd23cf..594a6a3d6 100644 --- a/wled00/wled_server.cpp +++ b/wled00/wled_server.cpp @@ -225,6 +225,7 @@ void initServer() size_t len, bool final) {handleUpload(request, filename, index, data, len, final);} ); +#ifdef WLED_ENABLE_SIMPLE_UI server.on("/simple.htm", HTTP_GET, [](AsyncWebServerRequest *request){ if (handleFileRead(request, "/simple.htm")) return; if (handleIfNoneMatchCacheHeader(request)) return; @@ -233,7 +234,8 @@ void initServer() setStaticContentCacheHeaders(response); request->send(response); }); - +#endif + server.on("/iro.js", HTTP_GET, [](AsyncWebServerRequest *request){ AsyncWebServerResponse *response = request->beginResponse_P(200, "application/javascript", iroJs, iroJs_length); response->addHeader(F("Content-Encoding"),"gzip"); @@ -388,7 +390,7 @@ void serveIndex(AsyncWebServerRequest* request) if (handleIfNoneMatchCacheHeader(request)) return; AsyncWebServerResponse *response; -#ifndef WLED_DISABLE_SIMPLE_UI +#ifdef WLED_ENABLE_SIMPLE_UI if (simplifiedUI) response = request->beginResponse_P(200, "text/html", PAGE_simple, PAGE_simple_L); else diff --git a/wled00/xml.cpp b/wled00/xml.cpp index ee67dfea9..619513133 100644 --- a/wled00/xml.cpp +++ b/wled00/xml.cpp @@ -406,7 +406,9 @@ void getSettingsJS(byte subPage, char* dest) { sappends('s',SET_F("DS"),serverDescription); sappend('c',SET_F("ST"),syncToggleReceive); + #ifdef WLED_ENABLE_SIMPLE_UI sappend('c',SET_F("SU"),simplifiedUI); + #endif } if (subPage == 4)