create database when it does not exist

This commit is contained in:
Ralf Bauer 2023-06-03 23:01:13 +02:00
parent b176a7ac1b
commit 64c6bd683a

View File

@ -49,7 +49,7 @@ bool WebApiDatabaseClass::write(float energy)
d.tm_mday = timeinfo.tm_mday;
d.energy = old_energy = energy;
File f = LittleFS.open(DATABASE_FILENAME, "a");
File f = LittleFS.open(DATABASE_FILENAME, "a", true);
if (!f) {
return (false);
}