запись в файл данных для графика

This commit is contained in:
Dmitry Borisenko
2022-08-24 00:59:44 +02:00
parent 5deb974b4e
commit bfaf586981
6 changed files with 29 additions and 17 deletions

View File

@@ -20,9 +20,13 @@ class Loging : public IoTItem {
if (value == "") {
SerialPrint("E", F("Logging"), F("no value set"));
} else {
regEvent(value, "Logging");
String logData = String(_time_local.second) + " " + value + "\r\n";
writeFile("log.txt", logData);
if (isTimeSynch) {
regEvent(value, "Logging");
String logData = String(unixTime) + " " + value + "\r\n";
addFileLn("/log.txt", logData);
} else {
SerialPrint("E", F("Logging"), F("cant logging - no time Synch"));
}
}
}
};