mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 22:52:19 +03:00
Добавляем функцию сохранения состояния элементов на flash
This commit is contained in:
@@ -14,6 +14,10 @@ void globalVarsSync() {
|
||||
settingsFlashJson = readFile(F("settings.json"), 4096);
|
||||
settingsFlashJson.replace("\r\n", "");
|
||||
|
||||
valuesFlashJson = readFile(F("values.json"), 4096);
|
||||
valuesFlashJson.replace("\r\n", "");
|
||||
|
||||
|
||||
mqttPrefix = jsonReadStr(settingsFlashJson, F("mqttPrefix"));
|
||||
mqttRootDevice = mqttPrefix + "/" + chipId;
|
||||
jsonWriteStr_(settingsFlashJson, "root", mqttRootDevice);
|
||||
@@ -34,6 +38,10 @@ void syncSettingsFlashJson() {
|
||||
writeFile(F("settings.json"), settingsFlashJson);
|
||||
}
|
||||
|
||||
void syncValuesFlashJson() {
|
||||
writeFile(F("values.json"), valuesFlashJson);
|
||||
}
|
||||
|
||||
const String getChipId() {
|
||||
return String(ESP_getChipId()) + "-" + String(ESP_getFlashChipId());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user