1.5.2: send() never rejects (status, error, scene, change report: resolves the topic or "" and reports the failure through the bridge's error event when listened to - 1.5.1 rejected, and an un-caught .send() killed the host on any broker hiccup); types ship (declaration: true, dist/*.d.ts tracked; addSupportedModes takes {value, modeResources}, ActionMapping payload optional, addHealthProp accepts EndpointHealth or the string); disconnect()/connect() re-binds devices to the new client; registerDevice returns the existing device on a duplicate endpointId (warning via the log hook, console.warn without one); ThermostatController discovery lists targetSetpoint and drops adaptiveRecoveryStatus; the UNSUPORTED INTERFACE TYPE stderr spam goes through the log hook. Examples: require("alex2node"), an error listener in each, EndpointHealth.OK, neutral endpoint ids, BlindControl reads correlationToken from the header, the thermostat reports Fahrenheit as Fahrenheit, ExamplePowerController is power-only again + new ExamplePowerControllerWithBrightness. readme (install from Forgejo, 1.5.2 changelog, table syntax), LICENSE (MIT); tests for the non-rejecting send, reconnect, duplicate, thermostat discovery and the shipped declaration signatures (8/8 on an in-process broker).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
717af632de
commit
275f00f8a7
35 changed files with 1011 additions and 176 deletions
107
dist/AlexaInterface.d.ts
vendored
Normal file
107
dist/AlexaInterface.d.ts
vendored
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
import { ActionMapping } from "./ActionMapping";
|
||||
export declare enum AlexaInterfaceType {
|
||||
APPLICATION_STATE_REPORTER = "Alexa.ApplicationStateReporter",
|
||||
AUDIO_PLAY_QUEUE = "Alexa.Audio.PlayQueue",
|
||||
AUTHORIZATION_CONTROLLER = "Alexa.AuthorizationController",
|
||||
AUTOMATION_MANAGEMENT = "Alexa.AutomationManagement",
|
||||
AUTOMOTIVE_VEHICLE_DATA = "Alexa.Automotive.VehicleData",
|
||||
BRIGHTNESS_CONTROLLER = "Alexa.BrightnessController",
|
||||
CAMERA_LIVE_VIEW_CONTROLLER = "Alexa.Camera.LiveViewController",
|
||||
CAMERA_STREAM_CONTROLLER = "Alexa.CameraStreamController",
|
||||
CHANNEL_CONTROLLER = "Alexa.ChannelController",
|
||||
COLOR_CONTROLLER = "Alexa.ColorController",
|
||||
COLOR_TEMPERATURE_CONTROLLER = "Alexa.ColorTemperatureController",
|
||||
COMMISSIONABLE = "Alexa.Commissionable",
|
||||
CONSENT_MANAGEMENT_CONSENT_REQUIRED_REPORTER = "Alexa.ConsentManagement.ConsentRequiredReporter",
|
||||
CONTACT_SENSOR = "Alexa.ContactSensor",
|
||||
COOKING = "Alexa.Cooking",
|
||||
COOKING_FOOD_TEMPERATURE_CONTROLLER = "Alexa.Cooking.FoodTemperatureController",
|
||||
COOKING_FOOD_TEMPERATURE_SENSOR = "Alexa.Cooking.FoodTemperatureSensor",
|
||||
COOKING_PRESET_CONTROLLER = "Alexa.Cooking.PresetController",
|
||||
COOKING_TEMPERATURE_CONTROLLER = "Alexa.Cooking.TemperatureController",
|
||||
COOKING_TEMPERATURE_SENSOR = "Alexa.Cooking.TemperatureSensor",
|
||||
COOKING_TIME_CONTROLLER = "Alexa.Cooking.TimeController",
|
||||
DATA_CONTROLLER = "Alexa.DataController",
|
||||
DEVICE_USAGE_ESTIMATION = "Alexa.DeviceUsage.Estimation",
|
||||
DEVICE_USAGE_METER = "Alexa.DeviceUsage.Meter",
|
||||
DOORBELL_EVENT_SOURCE = "Alexa.DoorbellEventSource",
|
||||
ENDPOINT_HEALTH = "Alexa.EndpointHealth",
|
||||
EQUALIZER_CONTROLLER = "Alexa.EqualizerController",
|
||||
INPUT_CONTROLLER = "Alexa.InputController",
|
||||
INVENTORY_LEVEL_SENSOR = "Alexa.InventoryLevelSensor",
|
||||
INVENTORY_LEVEL_USAGE_SENSOR = "Alexa.InventoryLevelUsageSensor",
|
||||
INVENTORY_USAGE_SENSOR = "Alexa.InventoryUsageSensor",
|
||||
KEYPAD_CONTROLLER = "Alexa.KeypadController",
|
||||
LAUNCHER = "Alexa.Launcher",
|
||||
LOCK_CONTROLLER = "Alexa.LockController",
|
||||
MEDIA_PLAYBACK = "Alexa.Media.Playback",
|
||||
MEDIA_PLAY_QUEUE = "Alexa.Media.PlayQueue",
|
||||
MEDIA_SEARCH = "Alexa.Media.Search",
|
||||
MODE_CONTROLLER = "Alexa.ModeController",
|
||||
MOTION_SENSOR = "Alexa.MotionSensor",
|
||||
PERCENTAGE_CONTROLLER = "Alexa.PercentageController",
|
||||
PLAYBACK_CONTROLLER = "Alexa.PlaybackController",
|
||||
PLAYBACK_STATE_REPORTER = "Alexa.PlaybackStateReporter",
|
||||
POWER_CONTROLLER = "Alexa.PowerController",
|
||||
POWER_LEVEL_CONTROLLER = "Alexa.PowerLevelController",
|
||||
PROACTIVE_NOTIFICATION_SOURCE = "Alexa.ProactiveNotificationSource",
|
||||
RANGE_CONTROLLER = "Alexa.RangeController",
|
||||
RECORD_CONTROLLER = "Alexa.RecordController",
|
||||
REMOTE_VIDEO_PLAYER = "Alexa.RemoteVideoPlayer",
|
||||
RTC_SESSION_CONTROLLER = "Alexa.RTCSessionController",
|
||||
SCENE_CONTROLLER = "Alexa.SceneController",
|
||||
SECURITY_PANEL_CONTROLLER = "Alexa.SecurityPanelController",
|
||||
SECURITY_PANEL_CONTROLLER_ALERT = "Alexa.SecurityPanelController.Alert",
|
||||
SEEK_CONTROLLER = "Alexa.SeekController",
|
||||
SIMPLE_EVENT_SOURCE = "Alexa.SimpleEventSource",
|
||||
SMART_VISION_OBJECT_DETECTION_SENSOR = "Alexa.SmartVision.ObjectDetectionSensor",
|
||||
SMART_VISION_SNAPSHOT_PROVIDER = "Alexa.SmartVision.SnapshotProvider",
|
||||
SPEAKER = "Alexa.Speaker",
|
||||
STEP_SPEAKER = "Alexa.StepSpeaker",
|
||||
TEMPERATURE_SENSOR = "Alexa.TemperatureSensor",
|
||||
THERMOSTAT_CONTROLLER = "Alexa.ThermostatController",
|
||||
THERMOSTAT_CONTROLLER_CONFIGURATION = "Alexa.ThermostatController.Configuration",
|
||||
THERMOSTAT_CONTROLLER_HVAC_COMPONENTS = "Alexa.ThermostatController.HVAC.Components",
|
||||
THERMOSTAT_CONTROLLER_SCHEDULE = "Alexa.ThermostatController.Schedule",
|
||||
TIME_HOLD_CONTROLLER = "Alexa.TimeHoldController",
|
||||
TOGGLE_CONTROLLER = "Alexa.ToggleController",
|
||||
UI_CONTROLLER = "Alexa.UIController",
|
||||
USER_PREFERENCE = "Alexa.UserPreference",
|
||||
VIDEO_RECORDER = "Alexa.VideoRecorder",
|
||||
WAKE_ON_LAN_CONTROLLER = "Alexa.WakeOnLANController",
|
||||
UNKNOWN = "UNKNOWN"
|
||||
}
|
||||
/** One ModeController mode as discovery lists it (configuration.supportedModes): the value plus its friendly names. */
|
||||
export interface SupportedMode {
|
||||
value: string;
|
||||
modeResources?: {
|
||||
friendlyNames: Array<{
|
||||
"@type": string;
|
||||
value: {
|
||||
text?: string;
|
||||
locale?: string;
|
||||
assetId?: string;
|
||||
};
|
||||
}>;
|
||||
};
|
||||
}
|
||||
export declare class AlexaInterface {
|
||||
type: AlexaInterfaceType;
|
||||
retrievable: boolean;
|
||||
proactivelyReported: boolean;
|
||||
instance: string;
|
||||
private friendlyNames;
|
||||
private actionMappings;
|
||||
private supportedModes;
|
||||
constructor(type: AlexaInterfaceType, retrievable?: boolean, proactivelyReported?: boolean, instance?: string);
|
||||
addActionMapping(mapping: ActionMapping): void;
|
||||
addFriendlyName(name: string, locale: string): void;
|
||||
/** The modes of a ModeController: { value, modeResources } objects as Alexa wants them (plain strings pass through as given). */
|
||||
addSupportedModes(modes: Array<string | SupportedMode>): void;
|
||||
setInstance(name: string): void;
|
||||
getType(): AlexaInterfaceType;
|
||||
getTypeString(): string;
|
||||
getVersion(): string;
|
||||
getProps(): string[];
|
||||
getJSON(): object;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue