The thermostat is described from its page: one, two or three setpoints with holdUntil, AdjustTargetTemperature, SetThermostatMode with the six modes (EM_HEAT is new), ResumeSchedule, adaptiveRecoveryStatus, and its seven error types under Alexa.ThermostatController. A declaration gives supportedModes, supportsScheduling and the properties the device has; without them discovery is what 1.5.2 sent: HEAT, COOL, AUTO, OFF and the three setpoints with thermostatMode. supportedModes without HEAT or COOL is refused where it is declared. ThermostatController.Schedule replaces its stub. Wire change for a 1.x declaration of it: version 3.2 (was 1) and scheduleEnabled listed (was nothing). SetAdaptiveRecovery is taken only with supportsAdaptiveRecovery. 24 examples of three pages are saved as fixtures; the page folds the SetWeeklySchedule example away, its payload is tested from the tables. 207 tests pass, 191 before. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
59 lines
2.5 KiB
TypeScript
59 lines
2.5 KiB
TypeScript
import { Capability } from "../device/Capability.js";
|
|
import type { CapabilityJson } from "../device/Capability.js";
|
|
import type { Label, Semantics } from "../registry/types.js";
|
|
import type { ActionMapping } from "./ActionMapping.js";
|
|
import type { AlexaInterfaceType } from "./enums.js";
|
|
/** 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;
|
|
};
|
|
}>;
|
|
};
|
|
}
|
|
interface Options {
|
|
semantics?: Semantics;
|
|
supportedModes?: Array<{
|
|
value: string;
|
|
friendlyNames: Label[];
|
|
}>;
|
|
ordered?: boolean;
|
|
}
|
|
/**
|
|
* A capability as 1.x declares it: device.addCapability(type, options), then the add and set methods below. It is a
|
|
* Capability, so what the methods set reaches discovery the same way as the options of device.add(). Nothing is
|
|
* refused here except an interface name the registry does not have: what Alexa would reject is logged by the bridge
|
|
* when it answers a discovery.
|
|
*/
|
|
export declare class AlexaInterface extends Capability<any, any, Options> {
|
|
constructor(type: AlexaInterfaceType | string, retrievable?: boolean, proactivelyReported?: boolean, instance?: string);
|
|
/** The namespace of the interface, which is the value of its AlexaInterfaceType member. */
|
|
get type(): AlexaInterfaceType;
|
|
addActionMapping(mapping: ActionMapping): void;
|
|
addFriendlyName(name: string, locale: string): void;
|
|
/**
|
|
* The modes of a ModeController, as { value, modeResources } objects. A mode given as a string is announced as
|
|
* { value } and noted: Alexa wants friendly names for it. ordered is true unless options.ordered says otherwise,
|
|
* as 1.x announced every mode list; with device.add() the default is false.
|
|
*/
|
|
addSupportedModes(modes: Array<string | SupportedMode>, options?: {
|
|
ordered?: boolean;
|
|
}): void;
|
|
setInstance(name: string): void;
|
|
getType(): AlexaInterfaceType;
|
|
/** @deprecated The same as getType(). */
|
|
getTypeString(): string;
|
|
/** @deprecated Read descriptor.version. */
|
|
getVersion(): string;
|
|
/** @deprecated The properties discovery lists: read properties.supported of toJSON(). */
|
|
getProps(): string[];
|
|
getJSON(): CapabilityJson;
|
|
toJSON(): CapabilityJson;
|
|
}
|
|
export {};
|