"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PowerController = void 0; const schema_js_1 = require("../schema.js"); const types_js_1 = require("../types.js"); exports.PowerController = (0, types_js_1.defineInterface)({ namespace: "Alexa.PowerController", version: "3", doc: "https://developer.amazon.com/docs/alexaplus/device-apis/alexa-powercontroller.html", kind: "controller", tier: 1, instanced: false, properties: { powerState: { name: "powerState", value: schema_js_1.s.enum("ON", "OFF") }, }, directives: { TurnOn: { name: "TurnOn", payload: schema_js_1.s.object({}) }, TurnOff: { name: "TurnOff", payload: schema_js_1.s.object({}) }, }, options: schema_js_1.s.object({ // The directives Alexa asks the user to confirm before it sends them. Amazon supports this for devices in Japan // only (alexa-discovery-objects.html, "VerificationsRequired object"). verificationsRequired: schema_js_1.s.optional(schema_js_1.s.array(schema_js_1.s.enum("TurnOn", "TurnOff"), { min: 1 })), }, { unknownKeys: "reject" }), discovery({ options }) { if (!options.verificationsRequired) return {}; const confirmed = options.verificationsRequired.map((directive) => ({ directive, methods: [{ "@type": "Confirmation" }] })); return { topLevel: { verificationsRequired: confirmed } }; }, });