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
|
|
@ -5,23 +5,19 @@
|
|||
#include "ProtoFrame.h"
|
||||
|
||||
// ModelEditor on the device: an edit of the shade model handed from the web
|
||||
// server task to loop(), which applies it with the ModelEditor rules and tells
|
||||
// the clients how it went.
|
||||
// server task to loop(), which applies it with the ModelEditor rules and replies
|
||||
// to the client that sent it.
|
||||
|
||||
// One edit on its way to loop(): the edit route and a copy of its request.
|
||||
// From an edit route its result goes to every client as requestResult; from a
|
||||
// protocol 2 edit op, as its reply.
|
||||
// One edit on its way to loop(): the protocol 2 edit op and a copy of its
|
||||
// arguments.
|
||||
struct model_edit_t {
|
||||
model_edit_type_t type = model_edit_type_t::add_room;
|
||||
uint32_t requestId = 0;
|
||||
proto_reply_to_t replyTo;
|
||||
JsonDocument doc;
|
||||
};
|
||||
|
||||
// One edit at a time: false when one is already waiting or running. Any task.
|
||||
bool beginModelEdit();
|
||||
// The id the HTTP reply and the requestResult event carry. Any task.
|
||||
uint32_t nextEditRequestId();
|
||||
// Gives up an edit that was begun but never queued. Any task.
|
||||
void cancelModelEdit(model_edit_t *edit);
|
||||
// Begins an edit of that type: nullptr when one is already waiting or running
|
||||
|
|
@ -30,10 +26,8 @@ model_edit_t *newModelEdit(model_edit_type_t type, bool &busy);
|
|||
// Hands a begun edit to loop(); false when the queue is full, and it is given
|
||||
// up. Any task.
|
||||
bool submitModelEdit(model_edit_t *edit);
|
||||
// Applies the edit, saves it, tells how it went and frees it. loop() only.
|
||||
// Applies the edit, saves it, replies and frees it. loop() only.
|
||||
void runModelEdit(model_edit_t *edit);
|
||||
// Applies the edit to the shade model and saves it. loop() only.
|
||||
edit_result_t applyModelEdit(model_edit_t &edit);
|
||||
// Tells every client how the edit went (SomfyEvents.cpp).
|
||||
void emitRequestResult(uint32_t requestId, const edit_result_t &result);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue