Commit graph

10 commits

Author SHA1 Message Date
c3d02f462e Announce a doorbell with proactivelyReported and a scene with supportsDeactivation
An interface without properties says beside its name what Alexa has to know
of it; the library left both out. With a board and Alexa on 2026-09-28 the
discovery of a doorbell was accepted (202), the endpoint was not listed, and
its DoorbellPress was answered with 500 INTERNAL_SERVICE_EXCEPTION.

DoorbellEventSource now always carries "proactivelyReported": true.
SceneController carries "supportsDeactivation", false until the sketch calls
setSupportsDeactivation(true); on another interface the call is refused and
logged. The Scene example says that it can be undone.

148 host tests. Light: static RAM 30,616 B, flash 332,705 B (+140 B).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-28 22:20:34 +00:00
69b4d59896 Examples as Arduino sketches: one folder per device type, each its own endpointId, Wi-Fi with a timeout
Light, DimmableLight, ColorTemperatureLight, ColorLight, TemperatureSensor, ContactSensor, Blind,
Thermostat, Lock, Scene, Doorbell and MultiDevice on the 2.0 API: addCapability(row, instance), one
onDirective() handler, the report helpers, ChangeReports from loop(), a deferred answer for the lock.
Wi-Fi is waited for 30 s, then the sketch says what to check and carries on.

examples/README.md has what each sketch does, its limits and the measured sizes for d1_mini: Light
takes 30,616 bytes of static RAM and 332,565 of flash; all 17 sketches build with 0 warnings.
test/test_examples compares the discovery object of every new sketch: 147 host tests (were 135).
The sketches were compiled, not run on a board.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-28 21:41:51 +00:00
7369883479 Examples of 1.x move to examples/legacy, one sketch folder each
basicLight, lightWithBrightness, lightWithColorTemp, tempSensor and blindControl become
examples/legacy/<name>/<name>.ino, which the Arduino IDE and PlatformIO both open. Their content is
unchanged: they keep proving that a 1.x sketch compiles against 2.0, and their discovery tests
(test/test_discovery) are untouched.

Built for d1_mini from the sketch folders, 0 warnings each; basicLight takes 30,520 bytes of static
RAM and 333,989 of flash, the same as before the move. library.json and the readme name the new
place.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-28 21:40:25 +00:00
21cc693e74 examples: handle the relative light directives. lightWithBrightness and lightWithColorTemp now act on AdjustBrightness (brightnessDelta, clamped 0-100); lightWithColorTemp starts at 2700 K instead of reporting 0 K (outside Alexa's 1000-10000 K range) and acts on IncreaseColorTemperature / DecreaseColorTemperature in 500 K steps. Verified on a D1 mini with Alexa: SetBrightness 10/100 and SetColorTemperature 7000/2200 K round-trip; the relative directives await a voice test.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-28 09:41:59 +00:00
87caad25be 1.1.0: begin(username, password, rootTopic) - the library signature now matches every example, the readme and the website (as published since 2024 no sketch could authenticate: the 64-hex password became the MQTT username). Discovery answers go out over MQTT directly, every device, resumed from loop() under heap pressure within the backend's 5 s window, instead of the 5-slot HTTP queue that silently dropped the rest (which the backend's reconcile then deleted from Alexa). JSON aligned with Alexa / alex2node: event.payload present, ActionMapping payload an object, semantics only when a capability has mappings. Pointer-stable device/capability containers (std::deque), the MQTT payload is copied by length before parsing (no write past the buffer), fragmented directive ids are ignored (a Discover is answered on its first fragment), deprecated ArduinoJson 7 calls replaced, credential Serial prints removed, ESP32 include guards (untested; the ESP8266 is the target). Examples: WIFI_PASSWORD, LED_BUILTIN fallback, string+int print fixes. library.json + library.properties restored (1.1.0; AsyncMqttClient, ArduinoJson 7, ESP Async TCP), LICENSE (MIT), a real keywords.txt, .gitattributes text=auto eol=lf (tree normalised to LF). readme: Forgejo URLs, platformio.ini snippet, Library Manager install, begin() order, INTERIOR_BLIND for blinds, 1.1.0 changelog. All five examples compile warning-free for d1_mini (PlatformIO 6.2, espressif8266) on pve-B450.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-28 04:58:38 +00:00
David
1313f47856 Add examples (brightness, color temp, temp sensor, blind control) + AlexaStatusMessage; update src/keywords/readme; drop library.json/properties 2024-12-24 12:00:00 +00:00
chaos511
f6691368f1 Add support for COLOR_TEMPERATURE_CONTROLLER 2024-12-23 20:38:25 -06:00
chaos511
8a1d862d56 Add support for TEMPERATURE_SENSOR 2024-12-18 23:46:38 -06:00
chaos511
7f5357dadf Add support for BRIGHTNESS_CONTROLLER 2024-12-18 20:51:35 -06:00
chaos511
85d59985d2 initial release 2024-12-18 16:44:06 -06:00