From 767b57fc010a72e0dd00f9c531b8c52eb05f783f Mon Sep 17 00:00:00 2001 From: cschwinne Date: Mon, 25 Nov 2019 00:20:00 +0100 Subject: [PATCH] Add "psave" field to state JSON --- wled00/wled00.ino | 2 +- wled00/wled05_init.ino | 7 +++---- wled00/wled19_json.ino | 3 +++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/wled00/wled00.ino b/wled00/wled00.ino index 937f1c898..560a59d59 100644 --- a/wled00/wled00.ino +++ b/wled00/wled00.ino @@ -99,7 +99,7 @@ //version code in format yymmddb (b = daily build) -#define VERSION 1911211 +#define VERSION 1911251 char versionString[] = "0.8.7-dev"; diff --git a/wled00/wled05_init.ino b/wled00/wled05_init.ino index a851a5d68..6ed76aec1 100644 --- a/wled00/wled05_init.ino +++ b/wled00/wled05_init.ino @@ -85,10 +85,6 @@ void wledInit() //HTTP server page init initServer(); - - strip.service(); - - initConnection(); } @@ -241,6 +237,9 @@ byte stacO = 0; void handleConnection() { //TODO: reconnect if heap <8000 + if (millis() < 2000 && (!WLED_WIFI_CONFIGURED || apBehavior == 2)) return; + if (lastReconnectAttempt == 0) initConnection(); + byte stac = 0; #ifdef ESP8266 stac = wifi_softap_get_station_num(); diff --git a/wled00/wled19_json.ino b/wled00/wled19_json.ino index 01525980b..f21c2c7ac 100644 --- a/wled00/wled19_json.ino +++ b/wled00/wled19_json.ino @@ -105,6 +105,9 @@ bool deserializeState(JsonObject root) } colorUpdated(noNotification ? 5:1); + ps = root["psave"] | -1; + if (ps >= 0) savePreset(ps); + return stateResponse; }