show progress bar when automatically installing firmware

This commit is contained in:
proddy
2025-01-21 22:06:01 +01:00
parent b8f97ec94d
commit 243471e21d
6 changed files with 46 additions and 37 deletions

View File

@@ -2061,7 +2061,12 @@ bool System::uploadFirmwareURL(const char * url) {
// we're about to start the upload, set the status so the Web System Monitor spots it
EMSESP::system_.systemStatus(SYSTEM_STATUS::SYSTEM_STATUS_UPLOADING);
// TODO do we need to stop the UART with EMSuart::stop() ?
// TODO do we need to stop the UART first with EMSuart::stop() ?
// set a callback so we can monitor progress in the WebUI
Update.onProgress([](size_t progress, size_t total) {
EMSESP::system_.systemStatus(SYSTEM_STATUS::SYSTEM_STATUS_UPLOADING+(progress * 100 / total));
});
// get tcp stream and send it to Updater
WiFiClient * stream = http.getStreamPtr();