bonamin and Claude Sonnet 4.6
7e8d91673f
fix: builtin aliases, cmd version default, relay compat, NTP UTC, player guards
...
BuiltInMelodies (F-018):
- 24 builtin_* UID aliases added for backward compat with old device PIDs
- Two new PROGMEM arrays: builtin_catehetical, builtin_mournfull_toll_alternative
- isBuiltInMelody() helper for lightweight PID existence check
- FileManager download-skip now uses isBuiltInMelody() instead of findMelodyByPID()
Command envelope version default (F-020):
- MQTT, UART, WebSocket transports: missing "v" field defaults to 1 (was 2)
- Fixes legacy adapter rejecting commands from app and Node-RED
RelayHandler v1/v2 compat (F-021):
- set_durations and set_outputs accept both nested {"bells":{...}} (v2)
and flat {...} (v1) payload shapes
NTP UTC fix (F-019):
- configTime(0,0,ntpServer) fetches raw UTC; stored gmtOffset+dstOffset
applied manually to epoch before writing RTC
- Eliminates double-offset bug from SDK internal timezone handling
Player guards (F-022):
- speed==0 defaults to 300ms instead of producing silent/broken playback
- calculateProjectedRunTime() guards against singleLoopDuration==0
Telemetry (F-023):
- bellMaxLoad default raised 200→500 to eliminate false overload warnings
Version bump: 2.0.1 → 2.0.3
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-06-30 09:52:39 +03:00
bonamin and Claude Sonnet 4.6
c3dc0a79bc
refactor(comms): clean up Communication folder structure
...
- Delete dead code: CommandHandler (700-line God Class) and
HTTPRequestHandler — both replaced by new architecture in Stage 4
- Create Drivers/ group for the three low-level protocol drivers,
mirroring the Transport/ pattern:
MQTTAsyncClient → Drivers/MQTTDriver (class: MQTTDriver)
WebSocketServer → Drivers/WebSocketDriver (class: WebSocketDriver)
UARTCommandHandler → Drivers/UARTDriver (class: UARTDriver)
- Update all includes and type references across CommunicationRouter,
all three Transport wrappers, and MQTTHandler
- Add -std=gnu++14 + build_unflags to platformio.ini so std::make_unique
compiles on ESP32 (required by CommunicationRouter::registerHandlers)
Build: passing
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-02-28 23:22:50 +02:00
bonamin and Claude Sonnet 4.6
682c604abe
feat(comms): Stages 3–6 — transport layer, router simplification, legacy adapter, WebServerTransport
...
## Stage 3 — Transport Layer
- MQTTTransport: wraps MQTTAsyncClient, implements ITransport
- WebSocketTransport: wraps WebSocketServer + ClientManager; broadcastToMasters/Secondary
- HTTPTransport: first-class HTTP identity (no more 0xFFFFFFFF fake WS client); registers
POST /api/command, GET /api/ping, GET /api/status; reply lambda captures AsyncWebServerRequest*
- UARTTransport: wraps UARTCommandHandler; UART whitelist enforced before dispatch
## Stage 4 — CommunicationRouter simplification
- Router now owns CommandBus + 4 transports; registerHandlers() wires all 10 domain handlers
- Old CommandHandler marked DEPRECATED on disk, no longer called
- HTTPRequestHandler no longer instantiated (replaced by HTTPTransport)
- ResponseBuilder::fromResult() factory method added
- main.cpp: all setXxxReference() calls moved before begin(); HealthMonitor + OutputManager wired
## Stage 5 — Legacy Adapter
- LegacyAdapter.hpp/cpp: 35 v1→v2 command mappings (simple 1:1, action-based, boolean splits)
- CommandBus::dispatch() applies translation when envelope.version == 1
## Stage 6 — WebServerTransport (4th transport, absorbs SettingsWebServer)
- WebServerTransport implements ITransport; registered in CommunicationRouter::begin()
- GET /settings: HTML settings page (PROGMEM template unchanged)
- POST /api/set-mode: routes network.set_config {permanent_ap_mode} through CommandBus
- POST /api/reboot: routes system.restart through CommandBus
- NetworkHandler::handleSetConfig: handles permanent_ap_mode field independently
- SettingsWebServer member removed from CommunicationRouter; src/SettingsWebServer/ is dead
code, deletable in a follow-up PR once SettingsPage.h is moved
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-02-28 22:54:43 +02:00