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", }, }, });