registry: Speaker, StepSpeaker, EqualizerController, PlaybackController, PlaybackStateReporter, InputController, ChannelController

Seven descriptors written from their pages replace seven stubs. All are version 3; 1.5.2 announced Speaker,
StepSpeaker, EqualizerController and PlaybackStateReporter as version 1, and all but ChannelController without
a property. StepSpeaker has no properties object in discovery and PlaybackController one without fields, next
to supportedOperations; a directive for an operation the device did not list is answered with
INVALID_DIRECTIVE. The equalizer declares bands, modes or both under "configurations", a TV its inputs from
the 61 names of the page.

Not described: the lineup of ChannelController, whose discovery example the page folds away. The discovery
examples of InputController spell one key "friendNames"; the fixtures have friendlyNames, as its table does.
62 examples of the six pages are saved as fixtures. 241 tests pass, 215 before.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
David 2026-09-28 20:54:53 +00:00
parent c59cf3ff10
commit d7dfc5b122
113 changed files with 3948 additions and 47 deletions

View file

@ -27,6 +27,18 @@ const inThreeLanguages = (english, spanish, french) => [text(english, "en-US"),
module.exports = [
{ namespace: "Alexa", page: "alexa-interface", declared: [{ options: {}, example: "discovery" }] },
{
namespace: "Alexa.ChannelController",
page: "alexa-channelcontroller",
// The page folds its two discovery examples away; the one of its AddOrUpdateReport has the same endpoint
declared: [{ options: reported, example: "discovery-addOrUpdateReport" }],
refused: [
["ChangeChannel", { channel: { number: 9 } }, "payload.channel.number: expected a string, got 9"],
["ChangeChannel", { channel: "KCTS" }, 'payload.channel: expected an object with number, callSign, affiliateCallSign, uri, got "KCTS"'],
["SkipChannels", { channelCount: 1.5 }, "payload.channelCount: expected an integer, got 1.5"],
],
unfit: [["channel", "9"], ["channel", { number: 9 }]],
},
{ namespace: "Alexa.BrightnessController", page: "alexa-brightnesscontroller", declared: [{ options: reported, example: "discovery" }] },
{
namespace: "Alexa.ColorController",
@ -50,7 +62,44 @@ module.exports = [
},
{ namespace: "Alexa.ContactSensor", page: "alexa-contactsensor", declared, unfit: [["detectionState", "OPEN"], ["detectionState", true]] },
{ namespace: "Alexa.EndpointHealth", page: "alexa-endpointhealth", declared: [{ options: reported, example: "discovery" }] },
{
namespace: "Alexa.EqualizerController",
page: "alexa-equalizercontroller",
declared: [{
example: "discovery",
options: {
...reported,
bands: { supported: ["BASS", "MIDRANGE", "TREBLE"], range: { minimum: -6, maximum: 6 } },
modes: ["MOVIE", "MUSIC", "SPORT"],
},
}],
refused: [
["SetMode", { mode: "OPERA" }, 'payload.mode: expected MOVIE | MUSIC | NIGHT | SPORT | TV, got "OPERA"'],
["SetBands", { bands: [{ name: "BASS", value: 1.5 }] }, "payload.bands[0].value: expected an integer, got 1.5"],
["AdjustBands", { bands: [{ name: "BASS", levelDelta: 3 }] }, "payload.bands[0].levelDirection: expected UP | DOWN, got nothing"],
["ResetBands", { bands: [] }, "payload.bands: expected a list with 1 or more entries, got []"],
],
unfit: [["mode", "OPERA"], ["bands", { name: "BASS", value: 0 }], ["bands", [{ name: "SUB", value: 0 }]]],
},
{ namespace: "Alexa.HumiditySensor", page: "alexa-humiditysensor", declared, unfit: [["relativeHumidity", 45], ["relativeHumidity", { value: 101 }]] },
{
namespace: "Alexa.InputController",
page: "alexa-inputcontroller",
// The two discovery examples of the page spell the friendlyNames of HDMI 1 "friendNames". The fixtures have the
// name of the table of the page.
declared: [{
example: "discovery",
options: {
...reported,
inputs: [{ name: "HDMI 1", friendlyNames: ["AnyCompany TV"] }, { name: "HDMI 2", friendlyNames: ["Cable", "AnyCompany Cable"] }],
},
}],
refused: [
["SelectInput", { input: "HDMI 11" }, 'payload.input: expected an input like HDMI 1, got "HDMI 11"'],
["SelectInput", {}, "payload.input: expected an input like HDMI 1, got nothing"],
],
unfit: [["input", "hdmi 1"], ["input", 1]],
},
{
namespace: "Alexa.LockController",
page: "alexa-lockcontroller",
@ -70,6 +119,21 @@ module.exports = [
],
unfit: [["percentage", -1], ["percentage", 50.5]],
},
{
namespace: "Alexa.PlaybackController",
page: "alexa-playbackcontroller",
declared: [{
example: "discovery",
options: { supportedOperations: ["Play", "Pause", "Stop", "Next", "Previous", "FastForward", "Rewind", "StartOver"] },
}],
refused: [["Play", "now", 'payload: expected an object, got "now"']],
},
{
namespace: "Alexa.PlaybackStateReporter",
page: "alexa-playbackcontroller",
declared,
unfit: [["playbackState", "PLAYING"], ["playbackState", { state: "REWINDING" }]],
},
{ namespace: "Alexa.PowerController", page: "alexa-powercontroller", declared: [{ options: reported, example: "discovery" }] },
{
namespace: "Alexa.PowerLevelController",
@ -132,6 +196,26 @@ module.exports = [
],
unfit: [["armState", "ARMED"], ["burglaryAlarm", "ALARM"], ["fireAlarm", { value: "FIRE" }]],
},
{
namespace: "Alexa.Speaker",
page: "alexa-speaker",
declared,
refused: [
["SetVolume", { volume: 101 }, "payload.volume: expected an integer from 0 to 100, got 101"],
["AdjustVolume", { volume: -20 }, "payload.volumeDefault: expected true or false, got nothing"],
["SetMute", { mute: "yes" }, 'payload.mute: expected true or false, got "yes"'],
],
unfit: [["volume", 50.5], ["volume", -1], ["muted", "no"]],
},
{
namespace: "Alexa.StepSpeaker",
page: "alexa-stepspeaker",
declared: [{ options: {}, example: "discovery" }],
refused: [
["AdjustVolume", { volumeSteps: 101 }, "payload.volumeSteps: expected an integer from -100 to 100, got 101"],
["SetMute", {}, "payload.mute: expected true or false, got nothing"],
],
},
{ namespace: "Alexa.TemperatureSensor", page: "alexa-temperaturesensor", declared: [{ options: reported, example: "discovery" }] },
{
namespace: "Alexa.ThermostatController",