errors: typed helpers for every documented error type
AlexaErrors has a helper for each of the 73 types of the table on alexa-errorresponse.html, named after the type in camel case: 63 take the message only, 10 take the payload fields their page documents. A field the page requires (reason, currentDeviceMode, currentChargeState, resourceType) is a required argument, so leaving it out does not compile; from JavaScript the helper throws a TypeError that lists the values. validRange is optional, as the page says, and has both ends when given. temperatureOutOfRange and setpointsTooClose stay as shorter names. The helpers are compared with the 15 examples of the four error pages. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
4a3dd81bcf
commit
94b13f733a
36 changed files with 874 additions and 138 deletions
|
|
@ -7,7 +7,7 @@ export declare const EndpointHealth: import("../types.js").InterfaceDescriptor<{
|
|||
connectivity: {
|
||||
name: string;
|
||||
value: import("../schema.js").Schema<import("../schema.js").InferShape<{
|
||||
value: import("../schema.js").EnumSchema<"OK" | "UNREACHABLE">;
|
||||
value: import("../schema.js").EnumSchema<"UNREACHABLE" | "OK">;
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
export declare const PowerController: import("../types.js").InterfaceDescriptor<{
|
||||
powerState: {
|
||||
name: string;
|
||||
value: import("../schema.js").EnumSchema<"ON" | "OFF">;
|
||||
value: import("../schema.js").EnumSchema<"OFF" | "ON">;
|
||||
};
|
||||
}, {
|
||||
TurnOn: {
|
||||
|
|
|
|||
|
|
@ -17,25 +17,25 @@ export declare const SecurityPanelController: import("../types.js").InterfaceDes
|
|||
burglaryAlarm: {
|
||||
name: string;
|
||||
value: import("../schema.js").Schema<import("../schema.js").InferShape<{
|
||||
value: import("../schema.js").EnumSchema<"OK" | "ALARM">;
|
||||
value: import("../schema.js").EnumSchema<"ALARM" | "OK">;
|
||||
}>>;
|
||||
};
|
||||
fireAlarm: {
|
||||
name: string;
|
||||
value: import("../schema.js").Schema<import("../schema.js").InferShape<{
|
||||
value: import("../schema.js").EnumSchema<"OK" | "ALARM">;
|
||||
value: import("../schema.js").EnumSchema<"ALARM" | "OK">;
|
||||
}>>;
|
||||
};
|
||||
carbonMonoxideAlarm: {
|
||||
name: string;
|
||||
value: import("../schema.js").Schema<import("../schema.js").InferShape<{
|
||||
value: import("../schema.js").EnumSchema<"OK" | "ALARM">;
|
||||
value: import("../schema.js").EnumSchema<"ALARM" | "OK">;
|
||||
}>>;
|
||||
};
|
||||
waterAlarm: {
|
||||
name: string;
|
||||
value: import("../schema.js").Schema<import("../schema.js").InferShape<{
|
||||
value: import("../schema.js").EnumSchema<"OK" | "ALARM">;
|
||||
value: import("../schema.js").EnumSchema<"ALARM" | "OK">;
|
||||
}>>;
|
||||
};
|
||||
}, {
|
||||
|
|
|
|||
|
|
@ -67,5 +67,5 @@ export declare const ThermostatController: import("../types.js").InterfaceDescri
|
|||
/** The user can set a temperature for a time: SetTargetTemperature comes with holdUntil. Default: false. */
|
||||
supportsScheduling: import("../schema.js").OptionalSchema<boolean>;
|
||||
/** The properties the thermostat has. Default: the three setpoints and thermostatMode. */
|
||||
properties: import("../schema.js").OptionalSchema<("targetSetpoint" | "lowerSetpoint" | "upperSetpoint" | "thermostatMode" | "adaptiveRecoveryStatus")[]>;
|
||||
properties: import("../schema.js").OptionalSchema<("thermostatMode" | "targetSetpoint" | "lowerSetpoint" | "upperSetpoint" | "adaptiveRecoveryStatus")[]>;
|
||||
}>, false>;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
export declare const ToggleController: import("../types.js").InterfaceDescriptor<{
|
||||
toggleState: {
|
||||
name: string;
|
||||
value: import("../schema.js").EnumSchema<"ON" | "OFF">;
|
||||
value: import("../schema.js").EnumSchema<"OFF" | "ON">;
|
||||
};
|
||||
}, {
|
||||
TurnOn: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue