restart after 1.9.x migration

This commit is contained in:
proddy
2020-08-30 21:14:14 +02:00
parent 2858437da2
commit bdc787b62b
2 changed files with 9 additions and 0 deletions

View File

@@ -31,6 +31,12 @@ class FSPersistence {
DeserializationError error = deserializeJson(jsonDocument, settingsFile); DeserializationError error = deserializeJson(jsonDocument, settingsFile);
if (error == DeserializationError::Ok && jsonDocument.is<JsonObject>()) { if (error == DeserializationError::Ok && jsonDocument.is<JsonObject>()) {
JsonObject jsonObject = jsonDocument.as<JsonObject>(); JsonObject jsonObject = jsonDocument.as<JsonObject>();
// debug added by Proddy
// Serial.printf("Read File: %s: ", _filePath);
// serializeJson(jsonDocument, Serial);
// Serial.println();
_statefulService->updateWithoutPropagation(jsonObject, _stateUpdater); _statefulService->updateWithoutPropagation(jsonObject, _stateUpdater);
settingsFile.close(); settingsFile.close();
return; return;
@@ -57,6 +63,7 @@ class FSPersistence {
return false; return false;
} }
// debug added by Proddy
// Serial.printf("Write File: %s: ", _filePath); // Serial.printf("Write File: %s: ", _filePath);
// serializeJson(jsonDocument, Serial); // serializeJson(jsonDocument, Serial);
// Serial.println(); // Serial.println();

View File

@@ -717,7 +717,9 @@ bool System::check_upgrade() {
}, },
"local"); "local");
Serial.println(F("Restarting..."));
Serial.end(); Serial.end();
restart(); // force a restart, nice and tidy
return true; return true;
#else #else
return false; return false;