src/registry/ holds what the library knows about an interface: namespace, version, the page it was read from, properties with their value schemas and directives with their payload schemas. Five interfaces are described (Alexa, PowerController, BrightnessController, TemperatureSensor, EndpointHealth); the other 65 names of AlexaInterfaceType are stubs with the version and property names of 1.5.2. schema.ts is the run-time check behind it (241 lines, no new dependency), catalog.ts the vocabularies of the pages: 103 assets (23 units), 6 actions, 9 states, 56 display categories, 22 reserved words, 73 error types under 11 namespaces. AlexaInterface.getVersion() and getProps() read the registry; the two switch statements are gone (-167 lines). On the wire: Alexa.EndpointHealth is announced at 3.1 (was 3.3; the page is titled 3.1 and no page mentions 3.3), and TimeHoldController and Camera.LiveViewController at 3 and 1.7 (1.5.2 sent the string "UNKNOWN"). DisplayCategory gains VACUUM. New exports: registry, DeclarationError, SchemaError, Assets, Units, Actions, States, DisplayCategories and the descriptor types. Tests: 20 JSON examples of the five pages under test/fixtures/alexa-docs; every directive payload and property value in them parses with its descriptor. npm test: 57 pass (was 30) in 10.8 s, also on Node 18.20.8 and 20.20.2. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
61 lines
3 KiB
JavaScript
61 lines
3 KiB
JavaScript
export var DisplayCategory;
|
|
(function (DisplayCategory) {
|
|
DisplayCategory["ACTIVITY_TRIGGER"] = "ACTIVITY_TRIGGER";
|
|
DisplayCategory["AIR_CONDITIONER"] = "AIR_CONDITIONER";
|
|
DisplayCategory["AIR_FRESHENER"] = "AIR_FRESHENER";
|
|
DisplayCategory["AIR_PURIFIER"] = "AIR_PURIFIER";
|
|
DisplayCategory["AIR_QUALITY_MONITOR"] = "AIR_QUALITY_MONITOR";
|
|
DisplayCategory["ALEXA_VOICE_ENABLED"] = "ALEXA_VOICE_ENABLED";
|
|
DisplayCategory["AUTO_ACCESSORY"] = "AUTO_ACCESSORY";
|
|
DisplayCategory["BLUETOOTH_SPEAKER"] = "BLUETOOTH_SPEAKER";
|
|
DisplayCategory["CAMERA"] = "CAMERA";
|
|
DisplayCategory["CHRISTMAS_TREE"] = "CHRISTMAS_TREE";
|
|
DisplayCategory["COFFEE_MAKER"] = "COFFEE_MAKER";
|
|
DisplayCategory["COMPUTER"] = "COMPUTER";
|
|
DisplayCategory["CONTACT_SENSOR"] = "CONTACT_SENSOR";
|
|
DisplayCategory["DISHWASHER"] = "DISHWASHER";
|
|
DisplayCategory["DOOR"] = "DOOR";
|
|
DisplayCategory["DOORBELL"] = "DOORBELL";
|
|
DisplayCategory["DRYER"] = "DRYER";
|
|
DisplayCategory["EXTERIOR_BLIND"] = "EXTERIOR_BLIND";
|
|
DisplayCategory["FAN"] = "FAN";
|
|
DisplayCategory["GAME_CONSOLE"] = "GAME_CONSOLE";
|
|
DisplayCategory["GARAGE_DOOR"] = "GARAGE_DOOR";
|
|
DisplayCategory["HEADPHONES"] = "HEADPHONES";
|
|
DisplayCategory["HUB"] = "HUB";
|
|
DisplayCategory["INTERIOR_BLIND"] = "INTERIOR_BLIND";
|
|
DisplayCategory["LAPTOP"] = "LAPTOP";
|
|
DisplayCategory["LIGHT"] = "LIGHT";
|
|
DisplayCategory["MICROWAVE"] = "MICROWAVE";
|
|
DisplayCategory["MOBILE_PHONE"] = "MOBILE_PHONE";
|
|
DisplayCategory["MOTION_SENSOR"] = "MOTION_SENSOR";
|
|
DisplayCategory["MUSIC_SYSTEM"] = "MUSIC_SYSTEM";
|
|
DisplayCategory["NETWORK_HARDWARE"] = "NETWORK_HARDWARE";
|
|
DisplayCategory["OTHER"] = "OTHER";
|
|
DisplayCategory["OVEN"] = "OVEN";
|
|
DisplayCategory["PHONE"] = "PHONE";
|
|
DisplayCategory["PRINTER"] = "PRINTER";
|
|
DisplayCategory["REMOTE"] = "REMOTE";
|
|
DisplayCategory["ROUTER"] = "ROUTER";
|
|
DisplayCategory["SCENE_TRIGGER"] = "SCENE_TRIGGER";
|
|
DisplayCategory["SCREEN"] = "SCREEN";
|
|
DisplayCategory["SECURITY_PANEL"] = "SECURITY_PANEL";
|
|
DisplayCategory["SECURITY_SYSTEM"] = "SECURITY_SYSTEM";
|
|
DisplayCategory["SLOW_COOKER"] = "SLOW_COOKER";
|
|
DisplayCategory["SMARTLOCK"] = "SMARTLOCK";
|
|
DisplayCategory["SMARTPLUG"] = "SMARTPLUG";
|
|
DisplayCategory["SPEAKER"] = "SPEAKER";
|
|
DisplayCategory["STREAMING_DEVICE"] = "STREAMING_DEVICE";
|
|
DisplayCategory["SWITCH"] = "SWITCH";
|
|
DisplayCategory["TABLET"] = "TABLET";
|
|
DisplayCategory["TEMPERATURE_SENSOR"] = "TEMPERATURE_SENSOR";
|
|
DisplayCategory["THERMOSTAT"] = "THERMOSTAT";
|
|
DisplayCategory["TV"] = "TV";
|
|
DisplayCategory["VACUUM_CLEANER"] = "VACUUM_CLEANER";
|
|
DisplayCategory["VACUUM"] = "VACUUM";
|
|
/** Not on the list of display categories any more; kept for 1.x callers. */
|
|
DisplayCategory["VEHICLE"] = "VEHICLE";
|
|
DisplayCategory["WASHER"] = "WASHER";
|
|
DisplayCategory["WATER_HEATER"] = "WATER_HEATER";
|
|
DisplayCategory["WEARABLE"] = "WEARABLE";
|
|
})(DisplayCategory || (DisplayCategory = {}));
|