registry: SceneController events, DoorbellEventSource, SimpleEventSource, TimeHoldController, InventoryLevelSensor, WakeOnLANController

Six descriptors written from their pages replace the last stubs of tiers 1 and 2. A scene answers Activate and
Deactivate through ctx.respond() with ActivationStarted and DeactivationStarted, the time and the cause filled
in. device.raise(descriptor, name, payload) publishes DoorbellPress and the Event of a button on <root>/event
with the endpoint and a new messageId; it throws a MessageError for an interface or instance the device did
not declare, an event that answers a directive, a payload that does not fit and a message over 16000 bytes.
TurnOn of a device with WakeOnLANController is deferred without the warning.

On the wire: a doorbell has no properties object and proactivelyReported on the capability; SimpleEventSource
is version 1.0, InventoryLevelSensor and WakeOnLANController version 3 (1.5.2: 1). A scene declared without
options is announced as before. Alex2MQTT has no topic yet for the WakeUp event.
24 examples of the six pages are saved as fixtures. 267 tests pass, 241 before.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
David 2026-09-28 21:01:53 +00:00
parent d7dfc5b122
commit 3a07c861b1
116 changed files with 3136 additions and 166 deletions

View file

@ -14,6 +14,7 @@
// unfit [[property, value]]: a value the property does not take
// chosen true: a declaration lists the properties the device has, an example some of those of the interface
// folded the directives whose example the page folds away, so that it was not saved
// endpoint { categories, description } of the endpoint the interface is declared on, where it has rules for them
//
// A directive is answered with a Response, or with the event responseFor() of its descriptor names.
//
@ -61,6 +62,12 @@ module.exports = [
unfit: [["colorTemperatureInKelvin", 10001], ["colorTemperatureInKelvin", "warm"]],
},
{ namespace: "Alexa.ContactSensor", page: "alexa-contactsensor", declared, unfit: [["detectionState", "OPEN"], ["detectionState", true]] },
{
namespace: "Alexa.DoorbellEventSource",
page: "alexa-doorbelleventsource",
endpoint: { categories: ["CAMERA", "DOORBELL"] },
declared: [{ options: {}, example: "discovery" }],
},
{ namespace: "Alexa.EndpointHealth", page: "alexa-endpointhealth", declared: [{ options: reported, example: "discovery" }] },
{
namespace: "Alexa.EqualizerController",
@ -100,6 +107,41 @@ module.exports = [
],
unfit: [["input", "hdmi 1"], ["input", 1]],
},
{
namespace: "Alexa.InventoryLevelSensor",
page: "alexa-inventorylevelsensor",
declared: [
{
example: "discovery",
options: {
retrievable: false,
proactivelyReported: true,
instance: "InkSensor.Cyan",
friendlyNames: [text("Cyan ink", "en-US"), text("Encre cyan", "fr-FR")],
measurement: { "@type": "Volume", unit: "MILLILITER" },
replenishment: { "@type": "DashReplenishmentId", value: "replenishment ID for refill options" },
},
},
{
example: "discovery",
n: 1,
options: {
retrievable: false,
proactivelyReported: true,
instance: "PaperSensor.FrontTray",
friendlyNames: [text("Front tray", "en-US")],
measurement: { "@type": "Count" },
replenishment: { "@type": "DashReplenishmentId", value: "replenishment ID for refill options" },
},
},
],
unfit: [
["level", 5],
["level", { "@type": "Volume", value: 5 }],
["level", { "@type": "Count", value: 200, unit: "SHEET" }],
["level", { "@type": "Length", value: 5, unit: "METER" }],
],
},
{
namespace: "Alexa.LockController",
page: "alexa-lockcontroller",
@ -175,6 +217,12 @@ module.exports = [
},
}],
},
{
namespace: "Alexa.SceneController",
page: "alexa-scenecontroller",
endpoint: { categories: ["SCENE_TRIGGER"], description: "Party scene by Sample Vendor" },
declared: [{ options: { supportsDeactivation: false }, example: "discovery" }],
},
{
namespace: "Alexa.SecurityPanelController",
page: "alexa-securitypanelcontroller",
@ -196,6 +244,8 @@ module.exports = [
],
unfit: [["armState", "ARMED"], ["burglaryAlarm", "ALARM"], ["fireAlarm", { value: "FIRE" }]],
},
// The page folds its discovery example away
{ namespace: "Alexa.SimpleEventSource", page: "alexa-simpleeventsource", declared: [] },
{
namespace: "Alexa.Speaker",
page: "alexa-speaker",
@ -270,6 +320,14 @@ module.exports = [
],
unfit: [["scheduleEnabled", "ON"], ["adaptiveRecoveryEnabled", 1]],
},
{
// The ChangeReport example of the page reports "2018-05-31T14:02.32Z", which is no time: it was not saved
namespace: "Alexa.TimeHoldController",
page: "alexa-timeholdcontroller",
declared: [{ options: { ...reported, allowRemoteResume: true }, example: "discovery" }],
refused: [["Hold", 10, "payload: expected an object, got 10"]],
unfit: [["holdStartTime", "14:30"], ["holdEndTime", "2018-05-31T14:40:00+02:00"]],
},
{
namespace: "Alexa.ToggleController",
page: "alexa-togglecontroller",
@ -314,4 +372,9 @@ module.exports = [
},
],
},
{
namespace: "Alexa.WakeOnLANController",
page: "alexa-wakeonlancontroller",
declared: [{ options: { macAddresses: ["00-14-22-01-23-45"] }, example: "discovery" }],
},
];