mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-10-31 13:52:15 +01:00
feat: remove the GitHub update
The release check, release list, download, cancel and /recoverFilesystem go, with the GitHub button and the Auto Check for Updates setting in the web UI (docs/adr/0007-no-github-update.md). The HTTPS session it needed failed for want of a 35-40 KB block (#76), it checked no certificate, and the web UI's buttons had been getting 404. Updates are uploads only (/updateFirmware, /updateApplication). The old socket still sends fwStatus with the installed versions, which the web UI and Home Assistant read. checkForUpdate stays in NVS and the backup file so their formats don't change. The release image shrinks by 126.5 KB: 142 KB of the OTA slot is free. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
539a49eb77
commit
83c946dd5f
14 changed files with 25 additions and 1009 deletions
|
|
@ -6,7 +6,6 @@
|
|||
#include "ConfigSettings.h"
|
||||
#include "Somfy.h"
|
||||
#include "ESPNetwork.h"
|
||||
#include "GitOTA.h"
|
||||
#include "Timing.h"
|
||||
#include "Utils.h"
|
||||
|
||||
|
|
@ -16,7 +15,6 @@ extern ConfigSettings settings;
|
|||
extern ESPNetwork net;
|
||||
extern SomfyShadeController somfy;
|
||||
extern SocketEmitter sockEmit;
|
||||
extern GitUpdater git;
|
||||
|
||||
AsyncWebServer wsServer(8080);
|
||||
AsyncWebSocket ws("/");
|
||||
|
|
@ -147,6 +145,20 @@ uint8_t SocketEmitter::activeClients(uint8_t room) {
|
|||
if(room < SOCK_MAX_ROOMS) return this->rooms[room].activeClients();
|
||||
return 0;
|
||||
}
|
||||
// The installed versions, in the fwStatus event the web UI and Home Assistant
|
||||
// read them from.
|
||||
static void emitFirmwareVersion(uint8_t num) {
|
||||
JsonSockEvent *json = sockEmit.beginEmit("fwStatus");
|
||||
json->beginObject();
|
||||
json->beginObject("fwVersion");
|
||||
settings.fwVersion.toJSON(json);
|
||||
json->endObject();
|
||||
json->beginObject("appVersion");
|
||||
settings.appVersion.toJSON(json);
|
||||
json->endObject();
|
||||
json->endObject();
|
||||
sockEmit.endEmit(num);
|
||||
}
|
||||
void SocketEmitter::initClients() {
|
||||
for(uint8_t i = 0; i < sizeof(this->newClients); i++) {
|
||||
uint8_t slot = this->newClients[i];
|
||||
|
|
@ -162,8 +174,8 @@ void SocketEmitter::initClients() {
|
|||
somfy.emitState(slot);
|
||||
logElapsed(TAG, "Socket init somfy state", step.lap());
|
||||
if(!ws.hasClient(asyncId)) { this->newClients[i] = 255; continue; }
|
||||
git.emitUpdateCheck(slot);
|
||||
logElapsed(TAG, "Socket init update check", step.lap());
|
||||
emitFirmwareVersion(slot);
|
||||
logElapsed(TAG, "Socket init firmware version", step.lap());
|
||||
if(!ws.hasClient(asyncId)) { this->newClients[i] = 255; continue; }
|
||||
net.emitSockets(slot);
|
||||
logElapsed(TAG, "Socket init network", step.lap());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue