AlexaCapability: instance, asset and text names, configuration, action and state mappings, nonControllable

AlexaCapability replaces the header-only AlexaInterface as what a device holds: 116 bytes with fixed places for
3 names, 4 action mappings and 2 state mappings, no std::vector or std::string. AlexaInterface and AlexaActions
stay as 1.x names; the five examples compile unchanged and announce the same bytes.
addCapability(row, instance) adds several capabilities of one generic controller. An instanced interface without
an instance or a name, an instance or semantics on an interface that takes none, and a full store are refused
with an ERROR line that says what to change.
PlaybackController and WakeOnLANController announce "properties": {} (AIF_EMPTY_PROPERTIES).
basicLight on a D1 mini: static RAM 30,788 -> 30,672 B, flash 330,509 -> 332,541 B; host tests 61 -> 77.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
David 2026-09-28 19:33:57 +00:00
parent 8b11cc2394
commit 7afc4346e8
12 changed files with 1084 additions and 253 deletions

View file

@ -2,7 +2,7 @@
; lib_deps (readme.md, Quick Start).
;
; pio test -e native host tests of the bridge logic (src/AlexaBridgeLogic.cpp) and of discovery
; (src/AlexaDevice.cpp, src/AlexaInterfaces.cpp); no board, no broker
; (src/AlexaDevice.cpp, src/AlexaCapability.cpp, src/AlexaInterfaces.cpp); no board, no broker
[platformio]
default_envs = native
@ -12,7 +12,7 @@ platform = native
test_framework = unity
; Only the sources without a hardware dependency are compiled with the tests
test_build_src = yes
build_src_filter = -<*> +<AlexaBridgeLogic.cpp> +<AlexaDevice.cpp> +<AlexaInterfaces.cpp> +<AlexaLog.cpp>
build_src_filter = -<*> +<AlexaBridgeLogic.cpp> +<AlexaCapability.cpp> +<AlexaDevice.cpp> +<AlexaInterfaces.cpp> +<AlexaLog.cpp>
lib_deps =
bblanchon/ArduinoJson@^7
; test/host_arduino holds the Arduino.h of the host: String, Print and Serial