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>
42 lines
1.3 KiB
TypeScript
42 lines
1.3 KiB
TypeScript
import { s } from "../schema.js";
|
|
import { defineInterface } from "../types.js";
|
|
|
|
// None of the fields is required, a channel has one of them at least
|
|
const channel = s.object({
|
|
/** "256", "13.1" */
|
|
number: s.optional(s.string()),
|
|
callSign: s.optional(s.string()),
|
|
affiliateCallSign: s.optional(s.string()),
|
|
uri: s.optional(s.string()),
|
|
});
|
|
|
|
/**
|
|
* The channel of a TV. ChangeChannel names the channel by one or more of number, callSign, affiliateCallSign and
|
|
* uri, or by channelMetadata.name alone. The lineup of a TV provider is not described: the page folds the discovery
|
|
* example that has one.
|
|
*/
|
|
export const ChannelController = defineInterface({
|
|
namespace: "Alexa.ChannelController",
|
|
version: "3",
|
|
doc: "https://developer.amazon.com/docs/alexaplus/device-apis/alexa-channelcontroller.html",
|
|
kind: "controller",
|
|
tier: 2,
|
|
instanced: false,
|
|
properties: {
|
|
channel: { name: "channel", value: channel },
|
|
},
|
|
directives: {
|
|
ChangeChannel: {
|
|
name: "ChangeChannel",
|
|
payload: s.object({
|
|
channel: s.optional(channel),
|
|
channelMetadata: s.optional(s.object({ name: s.optional(s.string()), image: s.optional(s.string()) })),
|
|
}),
|
|
},
|
|
SkipChannels: {
|
|
name: "SkipChannels",
|
|
payload: s.object({ channelCount: s.number({ integer: true }) }),
|
|
note: "above 0 up, below 0 down",
|
|
},
|
|
},
|
|
});
|