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
14
src/Somfy.h
14
src/Somfy.h
|
|
@ -2,7 +2,6 @@
|
|||
#define SOMFY_H
|
||||
#include <Preferences.h>
|
||||
#include "ConfigSettings.h"
|
||||
#include "WResp.h"
|
||||
|
||||
#include "SomfyFrame.h"
|
||||
#include "TxBuffer.h"
|
||||
|
|
@ -32,8 +31,6 @@ class SomfyRoom {
|
|||
void clear();
|
||||
bool save();
|
||||
bool fromJSON(JsonObject &obj);
|
||||
void emitState(const char *evt = "roomState");
|
||||
void emitState(uint8_t num, const char *evt = "roomState");
|
||||
void publish();
|
||||
void unpublish();
|
||||
};
|
||||
|
|
@ -136,15 +133,11 @@ class SomfyShade : public SomfyRemote, public ShadeSettings, private MotorLink,
|
|||
// Marks the shade as changed; the change fan-out sends shadeState once per
|
||||
// loop() pass.
|
||||
void emitState();
|
||||
// Sends evt about the shade to every client now.
|
||||
void emitState(const char *evt);
|
||||
void emitState(uint8_t num, const char *evt = "shadeState");
|
||||
// What changed since the fan-out last sent the shade (SHADE_CHANGED_* bits).
|
||||
uint16_t changed = 0;
|
||||
// A setting changed: protocol 2 clients get the whole shade.
|
||||
void configChanged() { this->changed |= SHADE_CHANGED_CONFIG; }
|
||||
void emitCommand(somfy_commands cmd, const char *source, uint32_t sourceAddress, const char *evt = "shadeCommand");
|
||||
void emitCommand(uint8_t num, somfy_commands cmd, const char *source, uint32_t sourceAddress, const char *evt = "shadeCommand");
|
||||
void emitCommand(somfy_commands cmd, const char *source, uint32_t sourceAddress);
|
||||
// False when the radio refused a command it sent.
|
||||
bool setMyPosition(int8_t pos, int8_t tilt = -1);
|
||||
bool moveToMyPosition();
|
||||
|
|
@ -213,9 +206,6 @@ class SomfyGroup : public SomfyRemote {
|
|||
// Marks the group as changed; the change fan-out sends groupState once per
|
||||
// loop() pass.
|
||||
void emitState();
|
||||
// Sends evt about the group to every client now.
|
||||
void emitState(const char *evt);
|
||||
void emitState(uint8_t num, const char *evt = "groupState");
|
||||
// What changed since the fan-out last sent the group (GROUP_CHANGED_* bits).
|
||||
uint8_t changed = 0;
|
||||
// A setting or its shades changed: protocol 2 clients get the whole group.
|
||||
|
|
@ -278,7 +268,6 @@ class SomfyShadeController {
|
|||
void processFrame(somfy_frame_t &frame, bool internal = false, const SomfyRemote *skip = nullptr);
|
||||
void markTxPending(uint32_t remoteAddress, uint32_t ticket, const SomfyRemote *skip = nullptr);
|
||||
void processTxEvent(const somfy_tx_event_t &evt);
|
||||
void emitState(uint8_t num = 255);
|
||||
// The change fan-out: sends every shade and group that changed since the
|
||||
// last pass, its changed MQTT topics and one state event. loop() only.
|
||||
void sendChanges();
|
||||
|
|
@ -287,7 +276,6 @@ class SomfyShadeController {
|
|||
void commit();
|
||||
void writeBackup();
|
||||
String backupData;
|
||||
bool loadShadesFile(const char *filename);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue