diff --git a/SomfyController.littlefs.bin b/SomfyController.littlefs.bin index 91e25ce..522edf3 100644 Binary files a/SomfyController.littlefs.bin and b/SomfyController.littlefs.bin differ diff --git a/data/index.js b/data/index.js index 9de084d..f549c6a 100644 --- a/data/index.js +++ b/data/index.js @@ -4128,12 +4128,25 @@ class Firmware { } } - installGitRelease(div) { + async installGitRelease(div) { + if (!this.isMobile()) { + console.log('Starting backup'); + try { + await firmware.backup(); + console.log('Backup Complete'); + } + catch (err) { + ui.serviceError(el, err); + return; + } + } + let obj = ui.fromElement(div); console.log(obj); putJSONSync(`/downloadFirmware?ver=${obj.version}`, {}, (err, ver) => { if (err) ui.serviceError(err); else { + general.reloadApp = true; // Change the display and allow the percentage to be shown when the socket emits the progress. let html = `
Installing ${ver.name}
Please wait as the files are downloaded and installed.
`; html += `
`; @@ -4144,7 +4157,6 @@ class Firmware { html += ``; html += ``; div.innerHTML = html; - } }); } @@ -4173,9 +4185,20 @@ class Firmware { } html += ``; html += ''; + if (this.isMobile()) { + html += `
WARNING
`; + html += '
This browser does not support automatic backups. It is highly recommended that you back up your configuration using the backup button before proceeding.
'; + } + else { + html += '
A backup file for your configuration will be downloaded to your browser. If the firmware update process fails please restore this file using the restore button after going through the onboarding process.
' + } html += `
`; + if (this.isMobile()) { + html += ``; + } html += ``; html += ``; + html += `
`; div.innerHTML = html;