messages: pure builders for every event the bridge sends
src/messages builds Response, StateReport, DeferredResponse, ErrorResponse, ChangeReport and the scene, doorbell and simple events from plain values; messageId and times are parameters, so a test compares whole objects. StateBuilder collects properties checked by the descriptors, AlexaError and AlexaErrors carry the payload fields of an error type. AlexaStatusMessage and AlexaErrorResponse move to src/compat and are written on the builders. On the wire, against 1.5.2: a DeferredResponse has no context key, a ChangeReport has no correlationToken, the namespace of an ErrorResponse follows its type, and a ChangeReport without a changed property is not published: send() resolves "" and the bridge reports an error that names the endpoint. 143 tests pass (108 before). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
2558e21787
commit
46fa06728c
68 changed files with 3410 additions and 1208 deletions
92
dist/types/AlexaErrorResponse.d.ts
vendored
92
dist/types/AlexaErrorResponse.d.ts
vendored
|
|
@ -1,92 +0,0 @@
|
|||
import type { MqttClient } from "mqtt";
|
||||
export declare enum AlexaErrorType {
|
||||
ALREADY_IN_OPERATION = "ALREADY_IN_OPERATION",
|
||||
AUTHORIZATION_REQUIRED = "AUTHORIZATION_REQUIRED",
|
||||
BRIDGE_UNREACHABLE = "BRIDGE_UNREACHABLE",
|
||||
BYPASS_NEEDED = "BYPASS_NEEDED",
|
||||
CLOUD_CONTROL_DISABLED = "CLOUD_CONTROL_DISABLED",
|
||||
CHILD_LOCK = "CHILD_LOCK",
|
||||
CONFIGURATION_UPDATE_NOT_ALLOWED = "CONFIGURATION_UPDATE_NOT_ALLOWED",
|
||||
COOK_DURATION_TOO_LONG = "COOK_DURATION_TOO_LONG",
|
||||
COOLING_LOCKOUT_TEMPERATURE_VALUE_OUT_OF_RANGE = "COOLING_LOCKOUT_TEMPERATURE_VALUE_OUT_OF_RANGE",
|
||||
COOLING_STAGES_EXCEEDS_LIMIT = "COOLING_STAGES_EXCEEDS_LIMIT",
|
||||
DATA_DELETION_NOT_SUPPORTED = "DATA_DELETION_NOT_SUPPORTED",
|
||||
DATA_RETRIEVAL_NOT_SUPPORTED = "DATA_RETRIEVAL_NOT_SUPPORTED",
|
||||
DEVICE_STUCK = "DEVICE_STUCK",
|
||||
DISABLED_BY_USER = "DISABLED_BY_USER",
|
||||
DO_NOT_DISTURB_MODE = "DO_NOT_DISTURB_MODE",
|
||||
DOOR_CLOSED_TOO_LONG = "DOOR_CLOSED_TOO_LONG",
|
||||
DOOR_OPEN = "DOOR_OPEN",
|
||||
DUAL_SETPOINTS_UNSUPPORTED = "DUAL_SETPOINTS_UNSUPPORTED",
|
||||
ENDPOINT_BUSY = "ENDPOINT_BUSY",
|
||||
ENDPOINT_CONTROL_UNAVAILABLE = "ENDPOINT_CONTROL_UNAVAILABLE",
|
||||
ENDPOINT_LOW_POWER = "ENDPOINT_LOW_POWER",
|
||||
ENDPOINT_UNREACHABLE = "ENDPOINT_UNREACHABLE",
|
||||
EXCEEDED_PIN_ATTEMPTS = "EXCEEDED_PIN_ATTEMPTS",
|
||||
EXPIRED_AUTHORIZATION_CREDENTIAL = "EXPIRED_AUTHORIZATION_CREDENTIAL",
|
||||
FAILED_TO_BOOTSTRAP_COMMISSIONING_PROCESS = "FAILED_TO_BOOTSTRAP_COMMISSIONING_PROCESS",
|
||||
FIRMWARE_OUT_OF_DATE = "FIRMWARE_OUT_OF_DATE",
|
||||
HARDWARE_MALFUNCTION = "HARDWARE_MALFUNCTION",
|
||||
HEATING_LOCKOUT_TEMPERATURE_VALUE_OUT_OF_RANGE = "HEATING_LOCKOUT_TEMPERATURE_VALUE_OUT_OF_RANGE",
|
||||
HEATING_STAGES_EXCEEDS_LIMIT = "HEATING_STAGES_EXCEEDS_LIMIT",
|
||||
INSUFFICIENT_PERMISSIONS = "INSUFFICIENT_PERMISSIONS",
|
||||
INSUFFICIENT_RESOURCE = "INSUFFICIENT_RESOURCE",
|
||||
INSUFFICIENT_SPACE = "INSUFFICIENT_SPACE",
|
||||
INTERNAL_ERROR = "INTERNAL_ERROR",
|
||||
INVALID_AUTHORIZATION_CREDENTIAL = "INVALID_AUTHORIZATION_CREDENTIAL",
|
||||
INVALID_AUXILIARY_HEATING_SYSTEM_TYPE = "INVALID_AUXILIARY_HEATING_SYSTEM_TYPE",
|
||||
INVALID_DIRECTIVE = "INVALID_DIRECTIVE",
|
||||
INVALID_SYSTEM_TYPE = "INVALID_SYSTEM_TYPE",
|
||||
INVALID_TARGET_STATE = "INVALID_TARGET_STATE",
|
||||
INVALID_TEMPERATURE_SCALE = "INVALID_TEMPERATURE_SCALE",
|
||||
INVALID_TERMINAL_CONNECTION = "INVALID_TERMINAL_CONNECTION",
|
||||
INVALID_VALUE = "INVALID_VALUE",
|
||||
MAINTENANCE_REQUIRED = "MAINTENANCE_REQUIRED",
|
||||
MAX_COMMISSIONING_LIMIT_REACHED = "MAX_COMMISSIONING_LIMIT_REACHED",
|
||||
MISSING_SETUP_INFORMATION = "MISSING_SETUP_INFORMATION",
|
||||
NO_SUCH_ENDPOINT = "NO_SUCH_ENDPOINT",
|
||||
NOT_CALIBRATED = "NOT_CALIBRATED",
|
||||
NOT_IN_OPERATION = "NOT_IN_OPERATION",
|
||||
NOT_READY = "NOT_READY",
|
||||
NOT_SUPPORTED_IN_CURRENT_MODE = "NOT_SUPPORTED_IN_CURRENT_MODE",
|
||||
NOT_SUPPORTED_WITH_CURRENT_BATTERY_CHARGE_STATE = "NOT_SUPPORTED_WITH_CURRENT_BATTERY_CHARGE_STATE",
|
||||
OBSTACLE_DETECTED = "OBSTACLE_DETECTED",
|
||||
PARTNER_APPLICATION_REDIRECTION = "PARTNER_APPLICATION_REDIRECTION",
|
||||
PIN_SETUP_REQUIRED = "PIN_SETUP_REQUIRED",
|
||||
POWER_LEVEL_NOT_SUPPORTED = "POWER_LEVEL_NOT_SUPPORTED",
|
||||
PREHEAT_REQUIRED = "PREHEAT_REQUIRED",
|
||||
PROBE_REQUIRED = "PROBE_REQUIRED",
|
||||
RATE_LIMIT_EXCEEDED = "RATE_LIMIT_EXCEEDED",
|
||||
REMOTE_START_NOT_SUPPORTED = "REMOTE_START_NOT_SUPPORTED",
|
||||
REMOVE_PROBE = "REMOVE_PROBE",
|
||||
REMOTE_START_DISABLED = "REMOTE_START_DISABLED",
|
||||
REQUESTED_SETPOINTS_TOO_CLOSE = "REQUESTED_SETPOINTS_TOO_CLOSE",
|
||||
SAFETY_BEAM_BREACHED = "SAFETY_BEAM_BREACHED",
|
||||
SUBSCRIPTION_REQUIRED = "SUBSCRIPTION_REQUIRED",
|
||||
TEMPERATURE_VALUE_OUT_OF_RANGE = "TEMPERATURE_VALUE_OUT_OF_RANGE",
|
||||
THERMOSTAT_IS_OFF = "THERMOSTAT_IS_OFF",
|
||||
TOO_MANY_FAILED_ATTEMPTS = "TOO_MANY_FAILED_ATTEMPTS",
|
||||
TRIPLE_SETPOINTS_UNSUPPORTED = "TRIPLE_SETPOINTS_UNSUPPORTED",
|
||||
UNABLE_TO_CHARGE = "UNABLE_TO_CHARGE",
|
||||
UNAUTHORIZED = "UNAUTHORIZED",
|
||||
UNCLEARED_ALARM = "UNCLEARED_ALARM",
|
||||
UNSUPPORTED_THERMOSTAT_MODE = "UNSUPPORTED_THERMOSTAT_MODE",
|
||||
UNCLEARED_TROUBLE = "UNCLEARED_TROUBLE",
|
||||
UNWILLING_TO_SET_SCHEDULE = "UNWILLING_TO_SET_SCHEDULE",
|
||||
UNWILLING_TO_SET_VALUE = "UNWILLING_TO_SET_VALUE",
|
||||
VALUE_OUT_OF_RANGE = "VALUE_OUT_OF_RANGE"
|
||||
}
|
||||
export declare class AlexaErrorResponse {
|
||||
private event;
|
||||
private rootTopic;
|
||||
private endpointId;
|
||||
private mqttClient;
|
||||
/** Where a failed publish is reported (set by the Device that built this message, 1.5.2): send() never rejects. */
|
||||
onPublishError?: (err: Error) => void;
|
||||
constructor(correlationToken: string, rootTopic: string, endpointId: string, mqttClient: MqttClient);
|
||||
setErrorMessage(type: string, message: string, otherParams?: Record<string, any>): void;
|
||||
toJSON(): {
|
||||
event: any;
|
||||
};
|
||||
send(sendAsync?: boolean): Promise<string>;
|
||||
}
|
||||
26
dist/types/compat/AlexaErrorResponse.d.ts
vendored
Normal file
26
dist/types/compat/AlexaErrorResponse.d.ts
vendored
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import type { MqttClient } from "mqtt";
|
||||
import type { ErrorResponseMessage } from "../messages/types.js";
|
||||
/** An ErrorResponse as 1.x builds it: device.getErrorMessage(token), setErrorMessage(), send(). */
|
||||
export declare class AlexaErrorResponse {
|
||||
private readonly correlationToken;
|
||||
private readonly rootTopic;
|
||||
private readonly endpointId;
|
||||
private readonly mqttClient;
|
||||
private error;
|
||||
private namespace?;
|
||||
private readonly messageId;
|
||||
/** Where a failed publish is reported (set by the Device that built this message, 1.5.2): send() never rejects. */
|
||||
onPublishError?: (err: Error) => void;
|
||||
constructor(correlationToken: string, rootTopic: string, endpointId: string, mqttClient: MqttClient);
|
||||
/**
|
||||
* The error to answer with. otherParams are the fields the type adds to the payload (validRange). The header
|
||||
* carries the namespace the type is documented under, Alexa.ThermostatController for THERMOSTAT_IS_OFF;
|
||||
* options.namespace names another.
|
||||
*/
|
||||
setErrorMessage(type: string, message: string, otherParams?: Record<string, any>, options?: {
|
||||
namespace?: string;
|
||||
}): void;
|
||||
toJSON(): ErrorResponseMessage;
|
||||
/** Resolves with the topic published to, or "" when the publish failed. Never rejects. */
|
||||
send(sendAsync?: boolean): Promise<string>;
|
||||
}
|
||||
|
|
@ -1,42 +1,25 @@
|
|||
import type { EndpointHealth, PowerController } from "./compat/enums.js";
|
||||
import type { MqttClient } from "mqtt";
|
||||
export declare enum ThermostatMode {
|
||||
OFF = "OFF",
|
||||
HEAT = "HEAT",
|
||||
COOL = "COOL",
|
||||
AUTO = "AUTO",
|
||||
ECO = "ECO",
|
||||
CUSTOM = "CUSTOM"
|
||||
}
|
||||
export declare enum TemperatureSensorScale {
|
||||
CELSIUS = "CELSIUS",
|
||||
FAHRENHEIT = "FAHRENHEIT"
|
||||
}
|
||||
interface ContextProperty {
|
||||
namespace: string;
|
||||
name: string;
|
||||
value: any;
|
||||
timeOfSample: string;
|
||||
uncertaintyInMilliseconds: number;
|
||||
instance?: string;
|
||||
}
|
||||
/** Why a ChangeReport is sent (Alexa.ChangeReport payload.change.cause.type). */
|
||||
export type ChangeCause = "APP_INTERACTION" | "PHYSICAL_INTERACTION" | "PERIODIC_POLL" | "RULE_TRIGGER" | "VOICE_INTERACTION";
|
||||
import type { ChangeCause, Property } from "../messages/types.js";
|
||||
import { TemperatureSensorScale } from "./enums.js";
|
||||
import type { EndpointHealth, PowerController } from "./enums.js";
|
||||
/**
|
||||
* A Response, StateReport, DeferredResponse or ChangeReport as 1.x builds it: device.getStatusMessage() or
|
||||
* device.getChangeReport(), the add...Prop() calls, send(). The values are not checked.
|
||||
*/
|
||||
export declare class AlexaStatusMessage {
|
||||
private context;
|
||||
/** ChangeReport only: the properties that changed (payload.change.properties); the rest go to context. */
|
||||
private changeProps;
|
||||
private changeCause;
|
||||
private target;
|
||||
private event;
|
||||
private rootTopic;
|
||||
private endpointId;
|
||||
private mqttClient;
|
||||
private isDeferred;
|
||||
private readonly correlationToken;
|
||||
private readonly rootTopic;
|
||||
private readonly endpointId;
|
||||
private readonly mqttClient;
|
||||
private readonly isResponse;
|
||||
private readonly isDeferred;
|
||||
private readonly changeCause;
|
||||
private readonly state;
|
||||
private readonly messageId;
|
||||
private estimatedDeferralInSeconds?;
|
||||
/** Where a failed publish is reported (set by the Device that built this message, 1.5.2): send() never rejects. */
|
||||
onPublishError?: (err: Error) => void;
|
||||
constructor(correlationToken: string, rootTopic: string, endpointId: string, mqttClient: MqttClient, isResponse?: boolean, isDeferred?: boolean, changeCause?: ChangeCause | null);
|
||||
private getTimestamp;
|
||||
private addProperty;
|
||||
/** ChangeReport: the add*Prop calls that follow describe what CHANGED (the default for a change report). */
|
||||
changed(): this;
|
||||
|
|
@ -44,12 +27,15 @@ export declare class AlexaStatusMessage {
|
|||
unchanged(): this;
|
||||
/** True for a ChangeReport (Device.getChangeReport). */
|
||||
isChangeReport(): boolean;
|
||||
/** The message as it will be published (for tests and logging). */
|
||||
/**
|
||||
* The message as it will be published (for tests and logging). A DeferredResponse has no context. Throws
|
||||
* MessageError for a ChangeReport without a changed property.
|
||||
*/
|
||||
toJSON(): {
|
||||
event: any;
|
||||
context: {
|
||||
properties: ContextProperty[];
|
||||
} | null;
|
||||
context?: {
|
||||
properties: Property[];
|
||||
};
|
||||
};
|
||||
addModeControllerProp(instance: string, value: string, uncertaintyInMs?: number): this;
|
||||
addThermostatModeProp(mode: string, uncertaintyInMs?: number): this;
|
||||
|
|
@ -62,13 +48,14 @@ export declare class AlexaStatusMessage {
|
|||
addBrightnessControllerProp(brightness: number, uncertaintyInMs?: number): this;
|
||||
addColorTemperatureControllerProp(colorTemp: number, uncertaintyInMs?: number): this;
|
||||
addToggleControllerProp(state: PowerController, instance: string, uncertaintyInMs?: number): this;
|
||||
addContextProp(prop: ContextProperty): this;
|
||||
/** A property built by the caller. It goes to the context, also in a ChangeReport after changed(). */
|
||||
addContextProp(prop: Property): this;
|
||||
/**
|
||||
* Publish: a Response/StateReport to <root>/<endpoint>/alexaResponce (sendAsync: deferredResponse), a ChangeReport
|
||||
* to <root>/changeReport (Alex2MQTT adds the user's token and posts it to the Alexa event gateway). Resolves with
|
||||
* the topic, or "" when the publish failed - the error then goes to the bridge's "error" event (when listened to).
|
||||
* Never rejects (1.5.1 did, so an un-caught send() could kill the host).
|
||||
* the topic, or "" when nothing was published: the publish failed, or the message is a ChangeReport without a
|
||||
* changed property, which Alex2MQTT would drop. The error then goes to the bridge's "error" event (when listened
|
||||
* to). Never rejects (1.5.1 did, so an un-caught send() could kill the host).
|
||||
*/
|
||||
send(sendAsync?: boolean): Promise<string>;
|
||||
}
|
||||
export {};
|
||||
94
dist/types/compat/enums.d.ts
vendored
94
dist/types/compat/enums.d.ts
vendored
|
|
@ -181,7 +181,7 @@ export declare const EndpointHealth: import("../index.js").InterfaceDescriptor<{
|
|||
name: string;
|
||||
value: import("../index.js").Schema<import("../registry/schema.js").InferShape<{
|
||||
value: import("../registry/schema.js").EnumSchema<"OK" | "UNREACHABLE">;
|
||||
reason: import("../registry/schema.js").OptionalSchema<"WIFI_BAD_PASSWORD" | "WIFI_AP_NOT_FOUND" | "WIFI_ROUTER_UNREACHABLE" | "WIFI_AP_CHANNEL_QUALITY_LOW" | "INTERNET_UNREACHABLE" | "CAPTIVE_PORTAL_CHECK_FAILED" | "UNKNOWN">;
|
||||
reason: import("../registry/schema.js").OptionalSchema<"UNKNOWN" | "WIFI_BAD_PASSWORD" | "WIFI_AP_NOT_FOUND" | "WIFI_ROUTER_UNREACHABLE" | "WIFI_AP_CHANNEL_QUALITY_LOW" | "INTERNET_UNREACHABLE" | "CAPTIVE_PORTAL_CHECK_FAILED">;
|
||||
}>>;
|
||||
note: string;
|
||||
};
|
||||
|
|
@ -190,4 +190,96 @@ export declare const EndpointHealth: import("../index.js").InterfaceDescriptor<{
|
|||
readonly UNREACHABLE: "UNREACHABLE";
|
||||
};
|
||||
export type EndpointHealth = (typeof Connectivity)[keyof typeof Connectivity];
|
||||
/** The modes of a thermostat the 1.x helpers know. */
|
||||
export declare enum ThermostatMode {
|
||||
OFF = "OFF",
|
||||
HEAT = "HEAT",
|
||||
COOL = "COOL",
|
||||
AUTO = "AUTO",
|
||||
ECO = "ECO",
|
||||
CUSTOM = "CUSTOM"
|
||||
}
|
||||
/** The scale of a temperature given to addTemperatureSensorProp() and addThermostatControllerProp(). */
|
||||
export declare enum TemperatureSensorScale {
|
||||
CELSIUS = "CELSIUS",
|
||||
FAHRENHEIT = "FAHRENHEIT"
|
||||
}
|
||||
/** The error types of alexa-errorresponse.html, "Error type values". */
|
||||
export declare enum AlexaErrorType {
|
||||
ALREADY_IN_OPERATION = "ALREADY_IN_OPERATION",
|
||||
AUTHORIZATION_REQUIRED = "AUTHORIZATION_REQUIRED",
|
||||
BRIDGE_UNREACHABLE = "BRIDGE_UNREACHABLE",
|
||||
BYPASS_NEEDED = "BYPASS_NEEDED",
|
||||
CLOUD_CONTROL_DISABLED = "CLOUD_CONTROL_DISABLED",
|
||||
CHILD_LOCK = "CHILD_LOCK",
|
||||
CONFIGURATION_UPDATE_NOT_ALLOWED = "CONFIGURATION_UPDATE_NOT_ALLOWED",
|
||||
COOK_DURATION_TOO_LONG = "COOK_DURATION_TOO_LONG",
|
||||
COOLING_LOCKOUT_TEMPERATURE_VALUE_OUT_OF_RANGE = "COOLING_LOCKOUT_TEMPERATURE_VALUE_OUT_OF_RANGE",
|
||||
COOLING_STAGES_EXCEEDS_LIMIT = "COOLING_STAGES_EXCEEDS_LIMIT",
|
||||
DATA_DELETION_NOT_SUPPORTED = "DATA_DELETION_NOT_SUPPORTED",
|
||||
DATA_RETRIEVAL_NOT_SUPPORTED = "DATA_RETRIEVAL_NOT_SUPPORTED",
|
||||
DEVICE_STUCK = "DEVICE_STUCK",
|
||||
DISABLED_BY_USER = "DISABLED_BY_USER",
|
||||
DO_NOT_DISTURB_MODE = "DO_NOT_DISTURB_MODE",
|
||||
DOOR_CLOSED_TOO_LONG = "DOOR_CLOSED_TOO_LONG",
|
||||
DOOR_OPEN = "DOOR_OPEN",
|
||||
DUAL_SETPOINTS_UNSUPPORTED = "DUAL_SETPOINTS_UNSUPPORTED",
|
||||
ENDPOINT_BUSY = "ENDPOINT_BUSY",
|
||||
ENDPOINT_CONTROL_UNAVAILABLE = "ENDPOINT_CONTROL_UNAVAILABLE",
|
||||
ENDPOINT_LOW_POWER = "ENDPOINT_LOW_POWER",
|
||||
ENDPOINT_UNREACHABLE = "ENDPOINT_UNREACHABLE",
|
||||
EXCEEDED_PIN_ATTEMPTS = "EXCEEDED_PIN_ATTEMPTS",
|
||||
EXPIRED_AUTHORIZATION_CREDENTIAL = "EXPIRED_AUTHORIZATION_CREDENTIAL",
|
||||
FAILED_TO_BOOTSTRAP_COMMISSIONING_PROCESS = "FAILED_TO_BOOTSTRAP_COMMISSIONING_PROCESS",
|
||||
FIRMWARE_OUT_OF_DATE = "FIRMWARE_OUT_OF_DATE",
|
||||
HARDWARE_MALFUNCTION = "HARDWARE_MALFUNCTION",
|
||||
HEATING_LOCKOUT_TEMPERATURE_VALUE_OUT_OF_RANGE = "HEATING_LOCKOUT_TEMPERATURE_VALUE_OUT_OF_RANGE",
|
||||
HEATING_STAGES_EXCEEDS_LIMIT = "HEATING_STAGES_EXCEEDS_LIMIT",
|
||||
INSUFFICIENT_PERMISSIONS = "INSUFFICIENT_PERMISSIONS",
|
||||
INSUFFICIENT_RESOURCE = "INSUFFICIENT_RESOURCE",
|
||||
INSUFFICIENT_SPACE = "INSUFFICIENT_SPACE",
|
||||
INTERNAL_ERROR = "INTERNAL_ERROR",
|
||||
INVALID_AUTHORIZATION_CREDENTIAL = "INVALID_AUTHORIZATION_CREDENTIAL",
|
||||
INVALID_AUXILIARY_HEATING_SYSTEM_TYPE = "INVALID_AUXILIARY_HEATING_SYSTEM_TYPE",
|
||||
INVALID_DIRECTIVE = "INVALID_DIRECTIVE",
|
||||
INVALID_SYSTEM_TYPE = "INVALID_SYSTEM_TYPE",
|
||||
INVALID_TARGET_STATE = "INVALID_TARGET_STATE",
|
||||
INVALID_TEMPERATURE_SCALE = "INVALID_TEMPERATURE_SCALE",
|
||||
INVALID_TERMINAL_CONNECTION = "INVALID_TERMINAL_CONNECTION",
|
||||
INVALID_VALUE = "INVALID_VALUE",
|
||||
MAINTENANCE_REQUIRED = "MAINTENANCE_REQUIRED",
|
||||
MAX_COMMISSIONING_LIMIT_REACHED = "MAX_COMMISSIONING_LIMIT_REACHED",
|
||||
MISSING_SETUP_INFORMATION = "MISSING_SETUP_INFORMATION",
|
||||
NO_SUCH_ENDPOINT = "NO_SUCH_ENDPOINT",
|
||||
NOT_CALIBRATED = "NOT_CALIBRATED",
|
||||
NOT_IN_OPERATION = "NOT_IN_OPERATION",
|
||||
NOT_READY = "NOT_READY",
|
||||
NOT_SUPPORTED_IN_CURRENT_MODE = "NOT_SUPPORTED_IN_CURRENT_MODE",
|
||||
NOT_SUPPORTED_WITH_CURRENT_BATTERY_CHARGE_STATE = "NOT_SUPPORTED_WITH_CURRENT_BATTERY_CHARGE_STATE",
|
||||
OBSTACLE_DETECTED = "OBSTACLE_DETECTED",
|
||||
PARTNER_APPLICATION_REDIRECTION = "PARTNER_APPLICATION_REDIRECTION",
|
||||
PIN_SETUP_REQUIRED = "PIN_SETUP_REQUIRED",
|
||||
POWER_LEVEL_NOT_SUPPORTED = "POWER_LEVEL_NOT_SUPPORTED",
|
||||
PREHEAT_REQUIRED = "PREHEAT_REQUIRED",
|
||||
PROBE_REQUIRED = "PROBE_REQUIRED",
|
||||
RATE_LIMIT_EXCEEDED = "RATE_LIMIT_EXCEEDED",
|
||||
REMOTE_START_NOT_SUPPORTED = "REMOTE_START_NOT_SUPPORTED",
|
||||
REMOVE_PROBE = "REMOVE_PROBE",
|
||||
REMOTE_START_DISABLED = "REMOTE_START_DISABLED",
|
||||
REQUESTED_SETPOINTS_TOO_CLOSE = "REQUESTED_SETPOINTS_TOO_CLOSE",
|
||||
SAFETY_BEAM_BREACHED = "SAFETY_BEAM_BREACHED",
|
||||
SUBSCRIPTION_REQUIRED = "SUBSCRIPTION_REQUIRED",
|
||||
TEMPERATURE_VALUE_OUT_OF_RANGE = "TEMPERATURE_VALUE_OUT_OF_RANGE",
|
||||
THERMOSTAT_IS_OFF = "THERMOSTAT_IS_OFF",
|
||||
TOO_MANY_FAILED_ATTEMPTS = "TOO_MANY_FAILED_ATTEMPTS",
|
||||
TRIPLE_SETPOINTS_UNSUPPORTED = "TRIPLE_SETPOINTS_UNSUPPORTED",
|
||||
UNABLE_TO_CHARGE = "UNABLE_TO_CHARGE",
|
||||
UNAUTHORIZED = "UNAUTHORIZED",
|
||||
UNCLEARED_ALARM = "UNCLEARED_ALARM",
|
||||
UNSUPPORTED_THERMOSTAT_MODE = "UNSUPPORTED_THERMOSTAT_MODE",
|
||||
UNCLEARED_TROUBLE = "UNCLEARED_TROUBLE",
|
||||
UNWILLING_TO_SET_SCHEDULE = "UNWILLING_TO_SET_SCHEDULE",
|
||||
UNWILLING_TO_SET_VALUE = "UNWILLING_TO_SET_VALUE",
|
||||
VALUE_OUT_OF_RANGE = "VALUE_OUT_OF_RANGE"
|
||||
}
|
||||
export {};
|
||||
|
|
|
|||
7
dist/types/device/Device.d.ts
vendored
7
dist/types/device/Device.d.ts
vendored
|
|
@ -1,11 +1,11 @@
|
|||
import { EventEmitter } from "events";
|
||||
import type { MqttClient } from "mqtt";
|
||||
import { AlexaErrorResponse } from "../AlexaErrorResponse.js";
|
||||
import { AlexaStatusMessage } from "../AlexaStatusMessage.js";
|
||||
import type { ChangeCause } from "../AlexaStatusMessage.js";
|
||||
import { AlexaErrorResponse } from "../compat/AlexaErrorResponse.js";
|
||||
import { AlexaInterface } from "../compat/AlexaInterface.js";
|
||||
import { AlexaStatusMessage } from "../compat/AlexaStatusMessage.js";
|
||||
import { DisplayCategory } from "../compat/enums.js";
|
||||
import type { AlexaInterfaceType } from "../compat/enums.js";
|
||||
import type { ChangeCause } from "../messages/types.js";
|
||||
import type { DisplayCategoryName } from "../registry/catalog.js";
|
||||
import type { Directives, InterfaceDescriptor, Properties } from "../registry/types.js";
|
||||
import { Capability } from "./Capability.js";
|
||||
|
|
@ -83,6 +83,7 @@ declare class Device extends EventEmitter {
|
|||
* A proactive Alexa.ChangeReport (1.5.1): add the changed properties (the default target), optionally
|
||||
* .unchanged() then the others, and .send() - it goes to <root>/changeReport, which Alex2MQTT forwards to the Alexa
|
||||
* event gateway with the user's token. Alexa only accepts it for capabilities registered with proactivelyReported.
|
||||
* Without a changed property send() publishes nothing and resolves with "": Alex2MQTT would drop the report.
|
||||
*/
|
||||
getChangeReport(cause?: ChangeCause): AlexaStatusMessage;
|
||||
/**
|
||||
|
|
|
|||
10
dist/types/index.d.ts
vendored
10
dist/types/index.d.ts
vendored
|
|
@ -10,10 +10,12 @@ export { PowerController, EndpointHealth } from "./compat/enums.js";
|
|||
export { asset, text, semantics, SemanticsBuilder } from "./registry/index.js";
|
||||
export { ASSETS as Assets, UNITS_OF_MEASURE as Units, ACTIONS as Actions, STATES as States, DISPLAY_CATEGORIES as DisplayCategories, } from "./registry/index.js";
|
||||
export type { ActionId, AssetId, DisplayCategoryName, StateId, UnitOfMeasure, ActionsToDirective, AnyDescriptor, CapabilityExtras, Declared, DirectiveDescriptor, EndpointView, EventDescriptor, InterfaceDescriptor, Label, PropertyDescriptor, Semantics, StatesToRange, StatesToValue, ActionName, StateName, Mode, Infer, Schema, Temperature, TimeInterval, } from "./registry/index.js";
|
||||
export * as messages from "./messages/index.js";
|
||||
export { AlexaError, AlexaErrors, MessageError, StateBuilder, property } from "./messages/index.js";
|
||||
export type { ChangeCause, ChangeReportMessage, DeferredResponseMessage, ErrorResponseMessage, Header, ProactiveEventMessage, Property, PropertyOptions, ResponseMessage, SceneEventMessage, } from "./messages/index.js";
|
||||
export { AlexaInterface } from "./compat/AlexaInterface.js";
|
||||
export type { SupportedMode } from "./compat/AlexaInterface.js";
|
||||
export { ActionMapping } from "./compat/ActionMapping.js";
|
||||
export { AlexaActions, AlexaInterfaceType, DisplayCategory, PowerState } from "./compat/enums.js";
|
||||
export { AlexaStatusMessage, TemperatureSensorScale, ThermostatMode } from "./AlexaStatusMessage.js";
|
||||
export type { ChangeCause } from "./AlexaStatusMessage.js";
|
||||
export { AlexaErrorType, AlexaErrorResponse } from "./AlexaErrorResponse.js";
|
||||
export { AlexaActions, AlexaErrorType, AlexaInterfaceType, DisplayCategory, PowerState, TemperatureSensorScale, ThermostatMode, } from "./compat/enums.js";
|
||||
export { AlexaStatusMessage } from "./compat/AlexaStatusMessage.js";
|
||||
export { AlexaErrorResponse } from "./compat/AlexaErrorResponse.js";
|
||||
|
|
|
|||
49
dist/types/messages/StateBuilder.d.ts
vendored
Normal file
49
dist/types/messages/StateBuilder.d.ts
vendored
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
import { CONNECTIVITY_REASONS } from "../registry/interfaces/EndpointHealth.js";
|
||||
import type { Infer } from "../registry/schema.js";
|
||||
import type { InterfaceDescriptor, Properties } from "../registry/types.js";
|
||||
import type { PropertyOptions } from "./property.js";
|
||||
import type { Property } from "./types.js";
|
||||
/** Where a property goes in a ChangeReport: with the ones that changed, or with the rest in the context. */
|
||||
export type Target = "context" | "change";
|
||||
/** A capability of a device: its properties are reported under its instance. */
|
||||
interface DeclaredCapability<P extends Properties> {
|
||||
readonly descriptor: InterfaceDescriptor<P, any, any, boolean>;
|
||||
readonly instance: string;
|
||||
}
|
||||
export interface StateBuilderOptions {
|
||||
/** Where the properties go until changed() or unchanged() says otherwise. Default: "context". */
|
||||
target?: Target;
|
||||
/** The time of a property that is given none. Default: the clock. */
|
||||
now?: () => Date;
|
||||
}
|
||||
/**
|
||||
* Collects the properties of one message. For a Response or a StateReport they are its context. For a ChangeReport
|
||||
* changed() and unchanged() say which of the two lists the properties that follow belong to.
|
||||
*/
|
||||
export declare class StateBuilder {
|
||||
private readonly lists;
|
||||
private target;
|
||||
private readonly now;
|
||||
constructor(options?: StateBuilderOptions);
|
||||
/**
|
||||
* A property of an interface the library describes, its value checked: set(PowerController, "powerState", "ON").
|
||||
* Given a capability of a device in place of the interface, the property carries the instance of the capability.
|
||||
* Throws SchemaError for a value Alexa would not take.
|
||||
*/
|
||||
set<P extends Properties, K extends keyof P & string>(source: InterfaceDescriptor<P, any, any, boolean> | DeclaredCapability<P>, name: K, value: Infer<P[K]["value"]>, options?: PropertyOptions): this;
|
||||
/** A property as given, nothing checked: for an interface or a value the library does not describe. */
|
||||
setRaw(namespace: string, name: string, value: unknown, options?: PropertyOptions): this;
|
||||
/** The connectivity of Alexa.EndpointHealth, which belongs in every report of an endpoint that declares it. */
|
||||
health(value: "OK" | "UNREACHABLE", reason?: (typeof CONNECTIVITY_REASONS)[number], options?: PropertyOptions): this;
|
||||
/** A property built elsewhere, to the list that is filled now or to the one named. */
|
||||
add(built: Property, target?: Target): this;
|
||||
/** The properties that follow are the ones that changed. */
|
||||
changed(): this;
|
||||
/** The properties that follow did not change: a ChangeReport lists them in its context. */
|
||||
unchanged(): this;
|
||||
/** The properties for the context of the message, in the order they were set. */
|
||||
get context(): Property[];
|
||||
/** The properties for payload.change of a ChangeReport. */
|
||||
get change(): Property[];
|
||||
}
|
||||
export {};
|
||||
97
dist/types/messages/build.d.ts
vendored
Normal file
97
dist/types/messages/build.d.ts
vendored
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
import type { ChangeCause, ChangeReportMessage, DeferredResponseMessage, ErrorResponseMessage, ProactiveEventMessage, Property, ResponseMessage, SceneEventMessage } from "./types.js";
|
||||
/** A message that would be dropped on its way to Alexa, refused where it is built. */
|
||||
export declare class MessageError extends Error {
|
||||
readonly endpointId: string;
|
||||
readonly problem: string;
|
||||
constructor(endpointId: string, problem: string);
|
||||
}
|
||||
interface Envelope {
|
||||
endpointId: string;
|
||||
/** Default: a new version 4 UUID, which is what Alexa recommends (message-guide.html, "Header object"). */
|
||||
messageId?: string;
|
||||
}
|
||||
interface Answer extends Envelope {
|
||||
/** The correlationToken of the directive that is answered. */
|
||||
correlationToken: string;
|
||||
}
|
||||
export interface ResponseFields extends Answer {
|
||||
/** Default: "Response". */
|
||||
name?: string;
|
||||
/** Default: "Alexa". An interface with a response of its own names it: Alexa.SecurityPanelController, Arm.Response. */
|
||||
namespace?: string;
|
||||
payload?: Record<string, unknown>;
|
||||
/** The state of the endpoint after the directive. */
|
||||
context?: readonly Property[];
|
||||
}
|
||||
/**
|
||||
* The answer to a directive (alexa-response.html, "Synchronous response"). An endpoint with nothing to report
|
||||
* answers with an empty list of properties, not without a context (state-reporting-for-smart-home-addons.html,
|
||||
* "Directive response example for a property that isn't retrievable").
|
||||
*/
|
||||
export declare function response(fields: ResponseFields): ResponseMessage;
|
||||
/** The answer to ReportState: every retrievable property of the endpoint. */
|
||||
export declare function stateReport(fields: Answer & {
|
||||
context?: readonly Property[];
|
||||
}): ResponseMessage;
|
||||
/**
|
||||
* "The directive arrived, the answer follows": no context, the state is in the Response that follows
|
||||
* (alexa-response.html, "Deferred response example").
|
||||
*/
|
||||
export declare function deferredResponse(fields: Answer & {
|
||||
estimatedDeferralInSeconds?: number;
|
||||
}): DeferredResponseMessage;
|
||||
export interface ErrorResponseFields extends Answer {
|
||||
/** "ENDPOINT_UNREACHABLE" */
|
||||
type: string;
|
||||
/** For the log of the skill. */
|
||||
message: string;
|
||||
/** The fields a type adds to the payload: validRange, currentDeviceMode. */
|
||||
extra?: Record<string, unknown>;
|
||||
/** Default: the namespace the type is documented under, see errorNamespace(). */
|
||||
namespace?: string;
|
||||
}
|
||||
/** The answer to a directive the endpoint could not follow (alexa-errorresponse.html). */
|
||||
export declare function errorResponse(fields: ErrorResponseFields): ErrorResponseMessage;
|
||||
export interface ChangeReportFields extends Envelope {
|
||||
/** Default: "PHYSICAL_INTERACTION". */
|
||||
cause?: ChangeCause;
|
||||
/** The properties that changed, at least one. */
|
||||
changed: readonly Property[];
|
||||
/** The other properties of the endpoint, as they are now. */
|
||||
context?: readonly Property[];
|
||||
}
|
||||
/**
|
||||
* A change of state nobody asked for. The header has no correlationToken (message-guide.html, "Header object").
|
||||
* A property that changed is left out of the context: it is reported in one of the two (same page, "Context
|
||||
* object"). Throws MessageError when nothing changed: Alex2MQTT drops such a report without a word.
|
||||
*/
|
||||
export declare function changeReport(fields: ChangeReportFields): ChangeReportMessage;
|
||||
export interface SceneEventFields extends Answer {
|
||||
/** true: ActivationStarted. false: DeactivationStarted. */
|
||||
activated: boolean;
|
||||
/** Default: "VOICE_INTERACTION", a scene is started by a directive. */
|
||||
cause?: ChangeCause;
|
||||
/** When the scene started. Default: now. */
|
||||
timestamp?: string | Date;
|
||||
}
|
||||
/** The answer to Activate and Deactivate of a scene (alexa-scenecontroller.html). */
|
||||
export declare function sceneEvent(fields: SceneEventFields): SceneEventMessage;
|
||||
export interface DoorbellPressFields extends Envelope {
|
||||
/** Default: "PHYSICAL_INTERACTION", somebody pressed the button. */
|
||||
cause?: ChangeCause;
|
||||
/** When the button was pressed. Default: now. */
|
||||
timestamp?: string | Date;
|
||||
}
|
||||
/** Somebody rang (alexa-doorbelleventsource.html). */
|
||||
export declare function doorbellPress(fields: DoorbellPressFields): ProactiveEventMessage;
|
||||
export interface SimpleEventFields extends Envelope {
|
||||
/** The instance of Alexa.SimpleEventSource that raises the event. */
|
||||
instance: string;
|
||||
/** The id of the event as discovery listed it: "Button.SinglePush.1". */
|
||||
id: string;
|
||||
/** When the event happened. Default: now. */
|
||||
timestamp?: string | Date;
|
||||
}
|
||||
/** An event of a button or a sensor that routines start on (alexa-simpleeventsource.html). */
|
||||
export declare function simpleEvent(fields: SimpleEventFields): ProactiveEventMessage;
|
||||
export {};
|
||||
52
dist/types/messages/errors.d.ts
vendored
Normal file
52
dist/types/messages/errors.d.ts
vendored
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
import type { Temperature } from "../registry/schema.js";
|
||||
/**
|
||||
* The namespace an ErrorResponse of this type goes under: the one the table of error types lists it with
|
||||
* (THERMOSTAT_IS_OFF: Alexa.ThermostatController, OBSTACLE_DETECTED: Alexa.Safety), Alexa for a type the table
|
||||
* does not have.
|
||||
*/
|
||||
export declare function errorNamespace(type: string): string;
|
||||
/** Thrown by a directive handler, or built to be sent: the directive is answered with this ErrorResponse. */
|
||||
export declare class AlexaError extends Error {
|
||||
/** "ENDPOINT_UNREACHABLE" */
|
||||
readonly type: string;
|
||||
/** payload.message: for the log of the skill, Alexa does not read it to the user. */
|
||||
readonly alexaMessage: string;
|
||||
/** The fields of the payload next to type and message. */
|
||||
readonly extra: Record<string, unknown>;
|
||||
/** The namespace of the header. */
|
||||
readonly namespace: string;
|
||||
constructor(type: string, message: string, extra?: Record<string, unknown>, namespace?: string);
|
||||
}
|
||||
export type CurrentDeviceMode = "ASLEEP" | "COLOR" | "DEMAND_RESPONSE" | "ECO" | "NOT_PROVISIONED" | "VACATION" | "OTHER";
|
||||
export type ControlUnavailableReason = "DEEP_SLEEP_MODE" | "OUT_OF_NETWORK_CONNECTIVITY" | "NO_CONNECTIVITY_PACKAGE_ENABLED" | "UNKNOWN";
|
||||
export type ChargeState = "ALREADY_CHARGED_TO_REQUIRED_LEVEL" | "CURRENTLY_CHARGING" | "FULLY_CHARGED" | "NOT_CONNECTED_TO_POWER";
|
||||
export declare const AlexaErrors: {
|
||||
/** An error of any type. */
|
||||
of(type: string, message: string, extra?: Record<string, unknown>): AlexaError;
|
||||
/** The value is outside what the endpoint takes. For a temperature: temperatureOutOfRange(). */
|
||||
valueOutOfRange(message: string, validRange: {
|
||||
minimumValue: number;
|
||||
maximumValue: number;
|
||||
}): AlexaError;
|
||||
temperatureOutOfRange(message: string, validRange: {
|
||||
minimumValue: Temperature;
|
||||
maximumValue: Temperature;
|
||||
}): AlexaError;
|
||||
/** A light showing a color asked for a color temperature: "COLOR". */
|
||||
notSupportedInCurrentMode(message: string, currentDeviceMode: CurrentDeviceMode): AlexaError;
|
||||
/** percentageState: what is left of the battery, 0 to 100. */
|
||||
endpointLowPower(message: string, percentageState?: number): AlexaError;
|
||||
endpointControlUnavailable(message: string, reason: ControlUnavailableReason): AlexaError;
|
||||
notSupportedWithCurrentBatteryChargeState(message: string, currentChargeState: ChargeState, currentChargeLevelInPercentage?: number): AlexaError;
|
||||
/** What has to be refilled. */
|
||||
insufficientResource(message: string, resourceType: "WATER"): AlexaError;
|
||||
/** What the user has to do first. */
|
||||
maintenanceRequired(message: string, maintenanceAction?: "EMPTY_BIN"): AlexaError;
|
||||
/** Goes under Alexa.ThermostatController. minimumTemperatureDelta: how far apart the setpoints have to be. */
|
||||
setpointsTooClose(message: string, minimumTemperatureDelta?: Temperature): AlexaError;
|
||||
/** Goes under Alexa.SecurityPanelController. With the endpoints listed, the user can bypass them by voice. */
|
||||
bypassNeeded(message: string, endpointsNeedingBypass?: Array<{
|
||||
friendlyName: string;
|
||||
endpointId?: string;
|
||||
}>): AlexaError;
|
||||
};
|
||||
9
dist/types/messages/index.d.ts
vendored
Normal file
9
dist/types/messages/index.d.ts
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
export { changeReport, deferredResponse, doorbellPress, errorResponse, response, sceneEvent, simpleEvent, stateReport, MessageError, } from "./build.js";
|
||||
export type { ChangeReportFields, DoorbellPressFields, ErrorResponseFields, ResponseFields, SceneEventFields, SimpleEventFields, } from "./build.js";
|
||||
export { AlexaError, AlexaErrors, errorNamespace } from "./errors.js";
|
||||
export type { ChargeState, ControlUnavailableReason, CurrentDeviceMode } from "./errors.js";
|
||||
export { property } from "./property.js";
|
||||
export type { PropertyOptions } from "./property.js";
|
||||
export { StateBuilder } from "./StateBuilder.js";
|
||||
export type { StateBuilderOptions, Target } from "./StateBuilder.js";
|
||||
export type { ChangeCause, ChangeReportMessage, Context, DeferredResponseMessage, Endpoint, ErrorResponseMessage, Event, Header, ProactiveEventMessage, Property, ResponseMessage, SceneEventMessage, } from "./types.js";
|
||||
16
dist/types/messages/property.d.ts
vendored
Normal file
16
dist/types/messages/property.d.ts
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import type { Property } from "./types.js";
|
||||
export interface PropertyOptions {
|
||||
/** The instance of a generic controller: "Blind.Lift". */
|
||||
instance?: string;
|
||||
/**
|
||||
* When the value last changed. Default: now. message-guide.html, "Property object": "don't set the same
|
||||
* timeOfSample value for all properties", so a device that knows when each value changed passes it.
|
||||
*/
|
||||
timeOfSample?: string | Date;
|
||||
/** How old the value may be, for a device that is polled. Default: 0. */
|
||||
uncertaintyInMilliseconds?: number;
|
||||
}
|
||||
/** A time as Alexa wants it: ISO 8601 in UTC. Text is taken as given. */
|
||||
export declare function isoTime(time?: string | Date): string;
|
||||
/** One property of a context or of a change, its fields in the order of the examples. */
|
||||
export declare function property(namespace: string, name: string, value: unknown, options?: PropertyOptions): Property;
|
||||
78
dist/types/messages/types.d.ts
vendored
Normal file
78
dist/types/messages/types.d.ts
vendored
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
/**
|
||||
* Why a property changed or an event was raised (message-guide.html, "Cause object"). RULE_TRIGGER is not in that
|
||||
* table; the ChangeReport examples of alexa-securitypanelcontroller.html and alexa-thermostatcontroller.html use it.
|
||||
*/
|
||||
export type ChangeCause = "APP_INTERACTION" | "PERIODIC_POLL" | "PHYSICAL_INTERACTION" | "RULE_TRIGGER" | "VOICE_INTERACTION";
|
||||
export interface Header {
|
||||
namespace: string;
|
||||
name: string;
|
||||
/** Alexa.SimpleEventSource: the instance that raised the event. */
|
||||
instance?: string;
|
||||
messageId: string;
|
||||
/** The token of the directive that is answered. An event nobody asked for has none. */
|
||||
correlationToken?: string;
|
||||
payloadVersion: string;
|
||||
}
|
||||
export interface Endpoint {
|
||||
endpointId: string;
|
||||
}
|
||||
/** One reported property (message-guide.html, "Property object"). */
|
||||
export interface Property {
|
||||
namespace: string;
|
||||
/** The instance of a generic controller. */
|
||||
instance?: string;
|
||||
name: string;
|
||||
value: unknown;
|
||||
/** When the value was sampled or last changed, ISO 8601 in UTC. */
|
||||
timeOfSample: string;
|
||||
uncertaintyInMilliseconds: number;
|
||||
}
|
||||
export interface Event<P = Record<string, unknown>> {
|
||||
header: Header;
|
||||
endpoint: Endpoint;
|
||||
payload: P;
|
||||
}
|
||||
export interface Context {
|
||||
properties: Property[];
|
||||
}
|
||||
/** A Response, a StateReport or the response of an interface that has its own (Arm.Response). */
|
||||
export interface ResponseMessage {
|
||||
event: Event;
|
||||
context: Context;
|
||||
}
|
||||
export interface DeferredResponseMessage {
|
||||
event: Event<{
|
||||
estimatedDeferralInSeconds?: number;
|
||||
}>;
|
||||
}
|
||||
export interface ErrorResponseMessage {
|
||||
event: Event<{
|
||||
type: string;
|
||||
message: string;
|
||||
} & Record<string, unknown>>;
|
||||
}
|
||||
export interface ChangeReportMessage {
|
||||
event: Event<{
|
||||
change: {
|
||||
cause: {
|
||||
type: ChangeCause;
|
||||
};
|
||||
properties: Property[];
|
||||
};
|
||||
}>;
|
||||
context: Context;
|
||||
}
|
||||
/** ActivationStarted or DeactivationStarted of a scene. */
|
||||
export interface SceneEventMessage {
|
||||
event: Event<{
|
||||
cause: {
|
||||
type: ChangeCause;
|
||||
};
|
||||
timestamp: string;
|
||||
}>;
|
||||
context: {};
|
||||
}
|
||||
/** An event a device raises by itself: DoorbellPress, the Event of Alexa.SimpleEventSource. */
|
||||
export interface ProactiveEventMessage {
|
||||
event: Event;
|
||||
}
|
||||
|
|
@ -8,7 +8,7 @@ export declare const EndpointHealth: import("../types.js").InterfaceDescriptor<{
|
|||
name: string;
|
||||
value: import("../schema.js").Schema<import("../schema.js").InferShape<{
|
||||
value: import("../schema.js").EnumSchema<"OK" | "UNREACHABLE">;
|
||||
reason: import("../schema.js").OptionalSchema<"WIFI_BAD_PASSWORD" | "WIFI_AP_NOT_FOUND" | "WIFI_ROUTER_UNREACHABLE" | "WIFI_AP_CHANNEL_QUALITY_LOW" | "INTERNET_UNREACHABLE" | "CAPTIVE_PORTAL_CHECK_FAILED" | "UNKNOWN">;
|
||||
reason: import("../schema.js").OptionalSchema<"UNKNOWN" | "WIFI_BAD_PASSWORD" | "WIFI_AP_NOT_FOUND" | "WIFI_ROUTER_UNREACHABLE" | "WIFI_AP_CHANNEL_QUALITY_LOW" | "INTERNET_UNREACHABLE" | "CAPTIVE_PORTAL_CHECK_FAILED">;
|
||||
}>>;
|
||||
note: string;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue