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>
24 lines
1.1 KiB
JavaScript
24 lines
1.1 KiB
JavaScript
import { s } from "../schema.js";
|
|
import { defineInterface } from "../types.js";
|
|
/** A speaker that can be set to a volume from 0 to 100. One that only takes steps is an Alexa.StepSpeaker. */
|
|
export const Speaker = defineInterface({
|
|
namespace: "Alexa.Speaker",
|
|
version: "3",
|
|
doc: "https://developer.amazon.com/docs/alexaplus/device-apis/alexa-speaker.html",
|
|
kind: "controller",
|
|
tier: 2,
|
|
instanced: false,
|
|
properties: {
|
|
volume: { name: "volume", value: s.number({ min: 0, max: 100, integer: true }) },
|
|
muted: { name: "muted", value: s.boolean() },
|
|
},
|
|
directives: {
|
|
SetVolume: { name: "SetVolume", payload: s.object({ volume: s.number({ min: 0, max: 100, integer: true }) }) },
|
|
AdjustVolume: {
|
|
name: "AdjustVolume",
|
|
payload: s.object({ volume: s.number({ min: -100, max: 100, integer: true }), volumeDefault: s.boolean() }),
|
|
note: "volume is the change. volumeDefault is true when the user named no amount",
|
|
},
|
|
SetMute: { name: "SetMute", payload: s.object({ mute: s.boolean() }) },
|
|
},
|
|
});
|