import { s } from "../schema.js"; import { defineInterface } from "../types.js"; export const CONNECTIVITY_REASONS = [ "WIFI_BAD_PASSWORD", "WIFI_AP_NOT_FOUND", "WIFI_ROUTER_UNREACHABLE", "WIFI_AP_CHANNEL_QUALITY_LOW", "INTERNET_UNREACHABLE", "CAPTIVE_PORTAL_CHECK_FAILED", "UNKNOWN", ]; /** * Version 3.1, as the page is titled. It defines connectivity only. Examples on other pages declare 3 and 3.2; * alex2node 1.x declared 3.3, which no page mentions. */ export const EndpointHealth = defineInterface({ namespace: "Alexa.EndpointHealth", version: "3.1", doc: "https://developer.amazon.com/docs/alexaplus/device-apis/alexa-endpointhealth.html", kind: "sensor", tier: 1, instanced: false, properties: { connectivity: { name: "connectivity", value: s.object({ value: s.enum("OK", "UNREACHABLE"), reason: s.optional(s.enum(...CONNECTIVITY_REASONS)), }), note: "in every Response, StateReport and ChangeReport; a change of it reported within three seconds", }, }, directives: {}, });