Skip to content

Commit

Permalink
Add "psave" field to state JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
Aircoookie committed Nov 24, 2019
1 parent 095429a commit 767b57f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion wled00/wled00.ino
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@


//version code in format yymmddb (b = daily build)
#define VERSION 1911211
#define VERSION 1911251
char versionString[] = "0.8.7-dev";


Expand Down
7 changes: 3 additions & 4 deletions wled00/wled05_init.ino
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,6 @@ void wledInit()

//HTTP server page init
initServer();

strip.service();

initConnection();
}


Expand Down Expand Up @@ -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();
Expand Down
3 changes: 3 additions & 0 deletions wled00/wled19_json.ino
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ bool deserializeState(JsonObject root)
}
colorUpdated(noNotification ? 5:1);

ps = root["psave"] | -1;
if (ps >= 0) savePreset(ps);

return stateResponse;
}

Expand Down

0 comments on commit 767b57f

Please sign in to comment.