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

@ -1,4 +1,4 @@
// The part of Arduino.h that AlexaDevice, AlexaInterface and AlexaLog use, for the host tests (pio test -e native):
// The part of Arduino.h that AlexaDevice, AlexaCapability and AlexaLog use, for the host tests (pio test -e native):
// String, Print and Serial. The program-memory helpers come from src/AlexaCompat.h. A board never sees this file.
#ifndef ALEX2ESP_HOST_ARDUINO_H
#define ALEX2ESP_HOST_ARDUINO_H