Skip to content

Commit e53aea7

Browse files
committed
add upload_progress event
1 parent ad1d22d commit e53aea7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/http_update.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include "lcd.h"
77
#include "debug.h"
88
#include "emonesp.h"
9-
9+
#include "web_server.h"
1010
#include <MongooseHttpClient.h>
1111
#include <Update.h>
1212

@@ -110,6 +110,11 @@ bool http_update_write(uint8_t *data, size_t len)
110110
lcd.display(text, 0, 1, 10 * 1000, LCD_DISPLAY_NOW);
111111

112112
DEBUG_PORT.printf("Update: %d%%\n", percent);
113+
114+
StaticJsonDocument<128> event;
115+
event["upload_progress"] = percent;
116+
web_server_event(event);
117+
113118
lastPercent = percent;
114119
}
115120
}

0 commit comments

Comments
 (0)