"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DoorbellEventSource = void 0; const events_js_1 = require("../events.js"); const types_js_1 = require("../types.js"); /** * A doorbell. It takes no directive and reports nothing; device.raise(DoorbellEventSource, "DoorbellPress") says * that somebody rang. Alexa wants 30 seconds between two presses of one doorbell, and announces a press when the * user switched the announcements on for the doorbell in the Alexa app. */ exports.DoorbellEventSource = (0, types_js_1.defineInterface)({ namespace: "Alexa.DoorbellEventSource", version: "3", doc: "https://developer.amazon.com/docs/alexaplus/device-apis/alexa-doorbelleventsource.html", kind: "eventSource", tier: 2, instanced: false, properties: {}, directives: {}, events: { DoorbellPress: { name: "DoorbellPress", payload: (0, events_js_1.happened)("PHYSICAL_INTERACTION"), topic: "proactive" }, }, // The capability is the announcement that the endpoint raises the event: proactivelyReported whatever was declared discovery: () => ({ properties: false, topLevel: { proactivelyReported: true } }), // alexa-doorbelleventsource.html, "Discovery" validate(capability, { displayCategories }) { const doorbell = displayCategories.indexOf("DOORBELL"); if (doorbell < 0) throw new types_js_1.DeclarationError(capability, "a doorbell has the display category DOORBELL"); if (displayCategories.indexOf("CAMERA") > doorbell) { throw new types_js_1.DeclarationError(capability, "a video doorbell lists the display category CAMERA before DOORBELL"); } }, });