mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-25 20:26:41 +00:00
Fix for blank config.json
This commit is contained in:
parent
65de337902
commit
cfaa08906d
@ -172,54 +172,57 @@ void configWriteConfig()
|
|||||||
bool changed = false;
|
bool changed = false;
|
||||||
|
|
||||||
#if HASP_USE_WIFI
|
#if HASP_USE_WIFI
|
||||||
changed = wifiGetConfig(settings[F("wifi")]);
|
changed = wifiGetConfig(settings[F("wifi")].to<JsonObject>());
|
||||||
if(changed) {
|
if(changed) {
|
||||||
Log.verbose(F("WIFI: Settings changed"));
|
Log.verbose(F("WIFI: Settings changed"));
|
||||||
writefile = true;
|
writefile = true;
|
||||||
}
|
}
|
||||||
#if HASP_USE_MQTT
|
#if HASP_USE_MQTT
|
||||||
changed = mqttGetConfig(settings[F("mqtt")]);
|
changed = mqttGetConfig(settings[F("mqtt")].to<JsonObject>());
|
||||||
if(changed) {
|
if(changed) {
|
||||||
Log.verbose(F("MQTT: Settings changed"));
|
Log.verbose(F("MQTT: Settings changed"));
|
||||||
|
configOutput(settings[F("mqtt")]);
|
||||||
writefile = true;
|
writefile = true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if HASP_USE_TELNET
|
#if HASP_USE_TELNET
|
||||||
changed = telnetGetConfig(settings[F("telnet")]);
|
changed = telnetGetConfig(settings[F("telnet")].to<JsonObject>());
|
||||||
if(changed) {
|
if(changed) {
|
||||||
Log.verbose(F("TELNET: Settings changed"));
|
Log.verbose(F("TELNET: Settings changed"));
|
||||||
|
configOutput(settings[F("telnet")]);
|
||||||
writefile = true;
|
writefile = true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if HASP_USE_MDNS
|
#if HASP_USE_MDNS
|
||||||
changed = mdnsGetConfig(settings[F("mdns")]);
|
changed = mdnsGetConfig(settings[F("mdns")].to<JsonObject>());
|
||||||
if(changed) {
|
if(changed) {
|
||||||
Log.verbose(F("MDNS: Settings changed"));
|
Log.verbose(F("MDNS: Settings changed"));
|
||||||
writefile = true;
|
writefile = true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if HASP_USE_HTTP
|
#if HASP_USE_HTTP
|
||||||
changed = httpGetConfig(settings[F("http")]);
|
changed = httpGetConfig(settings[F("http")].to<JsonObject>());
|
||||||
if(changed) {
|
if(changed) {
|
||||||
Log.verbose(F("HTTP: Settings changed"));
|
Log.verbose(F("HTTP: Settings changed"));
|
||||||
|
configOutput(settings[F("http")]);
|
||||||
writefile = true;
|
writefile = true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
changed = debugGetConfig(settings[F("debug")]);
|
changed = debugGetConfig(settings[F("debug")].to<JsonObject>());
|
||||||
if(changed) {
|
if(changed) {
|
||||||
Log.verbose(F("DEBUG: Settings changed"));
|
Log.verbose(F("DEBUG: Settings changed"));
|
||||||
writefile = true;
|
writefile = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
changed = guiGetConfig(settings[F("gui")]);
|
changed = guiGetConfig(settings[F("gui")].to<JsonObject>());
|
||||||
if(changed) {
|
if(changed) {
|
||||||
Log.verbose(F("GUI: Settings changed"));
|
Log.verbose(F("GUI: Settings changed"));
|
||||||
writefile = true;
|
writefile = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
changed = haspGetConfig(settings[F("hasp")]);
|
changed = haspGetConfig(settings[F("hasp")].to<JsonObject>());
|
||||||
if(changed) {
|
if(changed) {
|
||||||
Log.verbose(F("HASP: Settings changed"));
|
Log.verbose(F("HASP: Settings changed"));
|
||||||
writefile = true;
|
writefile = true;
|
||||||
@ -235,7 +238,7 @@ void configWriteConfig()
|
|||||||
file.close();
|
file.close();
|
||||||
if(size > 0) {
|
if(size > 0) {
|
||||||
Log.verbose(F("CONF: [SUCCESS] Saved %s"), configFile.c_str());
|
Log.verbose(F("CONF: [SUCCESS] Saved %s"), configFile.c_str());
|
||||||
configBackupToEeprom();
|
// configBackupToEeprom();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user