Version bump
All checks were successful
Test compiling project / test (push) Successful in 2m46s

This commit is contained in:
2025-02-22 21:45:50 +01:00
parent 102a842079
commit 32d35d7029
8 changed files with 74 additions and 9 deletions

View File

@@ -4,9 +4,11 @@
#include "../global_data/defines.h"
#include <Preferences.h>
#include <fetchOTA.h>
#include <AsyncWebSocket.h>
extern Preferences prefs;
extern OTAStatus ota_status;
extern AsyncWebSocket ws;
extern Version current_spiffs_version;
@@ -59,7 +61,7 @@ void update_progress(int cur, int total) {
if (cur != 0 ) {
ota_status.update_progress = total/cur;
}
ws.textAll(String(ota_status.update_progress).c_str());
Log.verbose("OTA Update progress: %d/%d", cur, total);
}
@@ -131,4 +133,15 @@ void run_ota_update_task(void* parameter) {
Log.verbose("Running OTA upgrade now with URL: %s", args->ota_status.update_url.c_str());
run_ota_update(args->ota_status.update_url, update_started, update_finished, update_progress, update_error);
vTaskDelete(NULL);
}
}
void onWsEvent(AsyncWebSocket *server, AsyncWebSocketClient *client, AwsEventType type,
void *arg, uint8_t *data, size_t len) {
if (type == WS_EVT_CONNECT) {
Serial.println("WebSocket client connected");
} else if (type == WS_EVT_DISCONNECT) {
Serial.println("WebSocket client disconnected");
} else if (type == WS_EVT_DATA) {
// Optionally process data received from the client
}
}