diff --git a/wled00/wled00.ino b/wled00/wled00.ino index 72e4c005..c717cdf3 100644 --- a/wled00/wled00.ino +++ b/wled00/wled00.ino @@ -100,7 +100,7 @@ //version code in format yymmddb (b = daily build) -#define VERSION 1910292 +#define VERSION 1910293 char versionString[] = "0.8.6"; @@ -283,6 +283,7 @@ uint16_t transitionDelayDefault = transitionDelay; uint16_t transitionDelayTemp = transitionDelay; unsigned long transitionStartTime; float tperLast = 0; //crossfade transition progress, 0.0f - 1.0f +bool jsonTransitionOnce = false; //nightlight bool nightlightActive = false; diff --git a/wled00/wled05_init.ino b/wled00/wled05_init.ino index f7ed3493..f84be5ac 100644 --- a/wled00/wled05_init.ino +++ b/wled00/wled05_init.ino @@ -293,6 +293,20 @@ void handleConnection() { } } +//by https://github.com/tzapu/WiFiManager/blob/master/WiFiManager.cpp +int getSignalQuality(int rssi) +{ + int quality = 0; + + if (rssi <= -100) { + quality = 0; + } else if (rssi >= -50) { + quality = 100; + } else { + quality = 2 * (rssi + 100); + } + return quality; +} bool checkClientIsMobile(String useragent) { diff --git a/wled00/wled08_led.ino b/wled00/wled08_led.ino index 49b6e0c5..540619a7 100644 --- a/wled00/wled08_led.ino +++ b/wled00/wled08_led.ino @@ -105,7 +105,8 @@ void colorUpdated(int callMode) if (fadeTransition) { //set correct delay if not using notification delay - if (callMode != 3) transitionDelayTemp = transitionDelay; + if (callMode != 3 && !jsonTransitionOnce) transitionDelayTemp = transitionDelay; + jsonTransitionOnce = false; if (transitionDelayTemp == 0) {setLedsStandard(); strip.trigger(); return;} if (transitionActive) diff --git a/wled00/wled19_json.ino b/wled00/wled19_json.ino index 9d02d457..e6642e57 100644 --- a/wled00/wled19_json.ino +++ b/wled00/wled19_json.ino @@ -16,6 +16,12 @@ bool deserializeState(JsonObject root) transitionDelay = root["transition"]; transitionDelay *= 100; } + if (root.containsKey("tt")) + { + transitionDelayTemp = root["tt"]; + transitionDelayTemp *= 100; + jsonTransitionOnce = true; + } int ps = root["ps"] | -1; if (ps >= 0) applyPreset(ps); @@ -182,15 +188,24 @@ void serializeInfo(JsonObject root) root["live"] = realtimeActive; root["fxcount"] = strip.getModeCount(); root["palcount"] = strip.getPaletteCount(); + + JsonObject wifi_info = root.createNestedObject("wifi"); + wifi_info["bssid"] = WiFi.BSSIDstr(); + wifi_info["signal"] = getSignalQuality(WiFi.RSSI()); + wifi_info["channel"] = WiFi.channel(); + #ifdef ARDUINO_ARCH_ESP32 root["arch"] = "esp32"; root["core"] = ESP.getSdkVersion(); //root["maxalloc"] = ESP.getMaxAllocHeap(); + root["lwip"] = 0; #else root["arch"] = "esp8266"; root["core"] = ESP.getCoreVersion(); //root["maxalloc"] = ESP.getMaxFreeBlockSize(); + root["lwip"] = LWIP_VERSION_MAJOR; #endif + root["freeheap"] = ESP.getFreeHeap(); root["uptime"] = millis()/1000;