NetDebug: store enabled in cfg.json
This commit is contained in:
@@ -17,6 +17,10 @@ void getStringFromJson(char* dest, const char* src, size_t len) {
|
||||
}
|
||||
|
||||
bool deserializeConfig(JsonObject doc, bool fromFS) {
|
||||
|
||||
//WLEDMM add USER_PRINT
|
||||
USER_PRINTF("deserializeConfig\n");
|
||||
|
||||
bool needsSave = false;
|
||||
//int rev_major = doc["rev"][0]; // 1
|
||||
//int rev_minor = doc["rev"][1]; // 0
|
||||
@@ -1022,6 +1026,9 @@ void serializeConfig() {
|
||||
JsonObject usermods_settings = doc.createNestedObject("um");
|
||||
usermods.addToConfig(usermods_settings);
|
||||
|
||||
//WLEDMM add USER_PRINT
|
||||
USER_PRINTF("serializeConfig\n");
|
||||
|
||||
File f = WLED_FS.open("/cfg.json", "w");
|
||||
if (f) serializeJson(doc, f);
|
||||
f.close();
|
||||
|
||||
@@ -670,7 +670,7 @@ function populateInfo(i)
|
||||
cn += `v${i.ver} <i>"${vcn}"</i><p>(WLEDMM_${i.ver} ${i.rel}.bin)</p><p><em>build ${i.vid}</em></p><table>
|
||||
${urows}
|
||||
${urows===""?'':'<tr><td colspan=2><hr style="height:1px;border-width:0;color:SeaGreen;background-color:Seagreen"></td></tr>'}
|
||||
${i.opt&0x100?inforow("Net Debug","<button class=\"btn btn-xs\" onclick=\"requestJson({'debug':"+(i.opt&0x0080?"false":"true")+"});\"><i class=\"icons "+(i.opt&0x0080?"on":"off")+"\"></i></button>"):''}
|
||||
${i.opt&0x100?inforow("Net Debug ☾","<button class=\"btn btn-xs\" onclick=\"requestJson({'netDebug':"+(i.opt&0x0080?"false":"true")+"});\"><i class=\"icons "+(i.opt&0x0080?"on":"off")+"\"></i></button>"):''}
|
||||
${inforow("Build",i.vid)}
|
||||
${inforow("Signal strength",i.wifi.signal +"% ("+ i.wifi.rssi, " dBm)")}
|
||||
${inforow("Uptime",getRuntimeStr(i.uptime))}
|
||||
|
||||
2168
wled00/html_ui.h
2168
wled00/html_ui.h
File diff suppressed because it is too large
Load Diff
@@ -342,8 +342,11 @@ bool deserializeState(JsonObject root, byte callMode, byte presetId)
|
||||
|
||||
bool stateResponse = root[F("v")] | false;
|
||||
|
||||
//WLEDMM: store netDebug
|
||||
#if defined(WLED_DEBUG_HOST)
|
||||
netDebugEnabled = root[F("debug")] | netDebugEnabled;
|
||||
bool oldValue = netDebugEnabled;
|
||||
netDebugEnabled = root[F("netDebug")] | netDebugEnabled;
|
||||
if (oldValue != netDebugEnabled) doSerializeConfig = true; //WLEDMM to make it will be stored in cfg.json! (tbd: check if this is the right approach)
|
||||
#endif
|
||||
|
||||
bool onBefore = bri;
|
||||
@@ -585,6 +588,11 @@ void serializeState(JsonObject root, bool forPreset, bool includeBri, bool segme
|
||||
serializeJson(root, temp);
|
||||
DEBUG_PRINTF("serializeState %s\n", temp.c_str());
|
||||
|
||||
//WLEDMM: store netDebug
|
||||
#if defined(WLED_DEBUG_HOST)
|
||||
root[F("netDebug")] = netDebugEnabled;
|
||||
#endif
|
||||
|
||||
if (includeBri) {
|
||||
root["on"] = (bri > 0);
|
||||
root["bri"] = briLast;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
// version code in format yymmddb (b = daily build)
|
||||
#define VERSION 2302232
|
||||
#define VERSION 2302401
|
||||
|
||||
//uncomment this if you have a "my_config.h" file you'd like to use
|
||||
//#define WLED_USE_MY_CONFIG
|
||||
|
||||
Reference in New Issue
Block a user