mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-03-30 17:02:12 +02:00
backup with RAM
This commit is contained in:
parent
9113e58ec4
commit
2509030c49
9 changed files with 121 additions and 19 deletions
|
|
@ -858,14 +858,11 @@ void Web::handleBackup(WebServer &server, bool attach) {
|
|||
}
|
||||
Serial.println("Saving current shade information");
|
||||
somfy.writeBackup();
|
||||
File file = LittleFS.open("/controller.backup", "r");
|
||||
if (!file) {
|
||||
Serial.println("Error opening shades.cfg");
|
||||
server.send(500, _encoding_text, "shades.cfg");
|
||||
if(somfy.backupData.length() == 0) {
|
||||
server.send(500, _encoding_text, "backup failed");
|
||||
return;
|
||||
}
|
||||
server.streamFile(file, _encoding_text);
|
||||
file.close();
|
||||
server.send(200, _encoding_text, somfy.backupData);
|
||||
}
|
||||
void Web::handleSetPositions(WebServer &server) {
|
||||
webServer.sendCORSHeaders(server);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue