import { s } from "../schema.js"; import { defineInterface } from "../types.js"; // alexa-property-schemas.html, "Color" const color = s.object({ hue: s.number({ min: 0, max: 360 }), saturation: s.number({ min: 0, max: 1 }), brightness: s.number({ min: 0, max: 1 }), }); /** * A light changes its hue and saturation and keeps the brightness it has: "ignore the brightness value of 1 in the * directive" (alexa-colorcontroller.html, "SetColor directive example"). */ export const ColorController = defineInterface({ namespace: "Alexa.ColorController", version: "3", doc: "https://developer.amazon.com/docs/alexaplus/device-apis/alexa-colorcontroller.html", kind: "controller", tier: 1, instanced: false, properties: { color: { name: "color", value: color }, }, directives: { SetColor: { name: "SetColor", payload: s.object({ color }) }, }, });