NetDebug: store enabled in cfg.json

This commit is contained in:
Ewoud
2023-02-24 22:32:04 +01:00
parent f00558c5f4
commit ebd1e61e78
5 changed files with 1102 additions and 1087 deletions

View File

@@ -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;