mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-10-31 22:02:17 +01:00
feat!: remove the old API, ports 8081 and 8080 (step 4a)
Step 4a of docs/SECURITY_PLAN.md. Port 80 keeps the eleven HTTP routes of ADR 0006 and the socket at /ws; everything else moved to protocol 2. - Port 8081 (ApiRoutes) and the socket on 8080 (SocketEmitter) are gone. Protocol 2 owns its frame buffer and loop-task check. - Port 80 drops every route the old web UI called: reads, edits, settings, scans, reboot, /shades.cfg, /discovery. HttpRoutes.cpp holds what stays. - ModelSnapshot, SnapshotSlots and the read documents are gone. The item snapshot types stay, as ItemSnapshot, for events, MQTT and the command replies. - Model edits reply only to their protocol 2 op: requestResult goes. - The settings' toJSON writers, used only by the settings routes, go. - The _espsomfy_rts._tcp mDNS record moves to port 80, with path=/ws. - The memory event reports the loop-rate window it closes. - A deleted room no longer re-publishes its retained MQTT topics. - e2e: the heap check reads the sync's status; the sync is checked on its own instead of against /controller. - README gets an API and ports section. BREAKING CHANGE: ports 8081 and 8080 and the old HTTP routes are gone. Home Assistant needs integration 3.0.0 or newer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
c91c20d444
commit
2a954aa158
53 changed files with 613 additions and 3549 deletions
|
|
@ -1,17 +1,13 @@
|
|||
#ifndef WEB_ROUTES_H
|
||||
#define WEB_ROUTES_H
|
||||
#include <ESPAsyncWebServer.h>
|
||||
#include "Somfy.h"
|
||||
#include "LoopQueue.h"
|
||||
#include "ModelSnapshot.h"
|
||||
|
||||
// What WebUiRoutes, ApiRoutes and the handlers both of them call (Web.cpp)
|
||||
// share. Internal to the web servers.
|
||||
// What HttpRoutes and the handlers it calls (Web.cpp) share. Internal to the
|
||||
// web server.
|
||||
|
||||
// Registers the routes the config web UI calls on port 80, and its files.
|
||||
void registerWebUiRoutes(AsyncWebServer &server);
|
||||
// Registers the routes integrations such as Home Assistant call on port 8081.
|
||||
void registerApiRoutes(AsyncWebServer &server);
|
||||
// Registers the HTTP routes on port 80, and the web UI's files.
|
||||
void registerHttpRoutes(AsyncWebServer &server);
|
||||
|
||||
#define WEB_MAX_RESPONSE 4096
|
||||
// Where replies are formatted before they are sent. async_tcp only.
|
||||
|
|
@ -19,26 +15,10 @@ extern char g_async_content[WEB_MAX_RESPONSE];
|
|||
extern const char _encoding_text[];
|
||||
extern const char _encoding_json[];
|
||||
|
||||
// Sent when a request can't be handed to loop().
|
||||
void sendQueueFull(AsyncWebServerRequest *request);
|
||||
// Sent when the radio can't take a frame (suspended or queue full).
|
||||
void sendRadioUnavailable(AsyncWebServerRequest *request);
|
||||
// Hands an item to loop(), which owns the shades. When it can't be the
|
||||
// request is answered with the reason and false is returned.
|
||||
bool queueLoopItem(AsyncWebServerRequest *request, const loop_item_t &item);
|
||||
bool queueShadeRequest(AsyncWebServerRequest *request, const shade_request_t &req);
|
||||
// A query parameter, or an empty string when it is missing.
|
||||
String asyncParam(AsyncWebServerRequest *request, const char *name);
|
||||
bool asyncHasParam(AsyncWebServerRequest *request, const char *name);
|
||||
// Serves a read from a ModelSnapshot that loop() fills.
|
||||
void sendSnapshot(AsyncWebServerRequest *request, snapshot_doc_t doc, uint8_t id = 0, snapshot_header_t header = nullptr);
|
||||
|
||||
// One item of a reply, copied from the live shade model.
|
||||
void serializeShadeRef(SomfyShade *shade, JsonFormatter &json);
|
||||
void serializeShade(SomfyShade *shade, JsonFormatter &json);
|
||||
void serializeShade(SomfyShade *shade, JsonFormatter &json, bool paired, uint16_t lastRollingCode);
|
||||
void serializeTransceiverConfig(JsonFormatter &json);
|
||||
void serializeAppVersion(JsonFormatter &json, appver_t &ver);
|
||||
// The installed firmware and web application versions.
|
||||
void serializeVersion(JsonFormatter &json);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue