registry: ThermostatController 3.2 and ThermostatController.Schedule

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>
This commit is contained in:
David 2026-09-28 20:34:49 +00:00
parent af1489696d
commit f555a5df70
67 changed files with 2445 additions and 58 deletions

View file

@ -12,6 +12,8 @@
// refused [[directive, payload, message]]: a payload the directive does not take, and the message of the
// INVALID_VALUE that answers it
// unfit [[property, value]]: a value the property does not take
// chosen true: a declaration lists the properties the device has, an example some of those of the interface
// folded the directives whose example the page folds away, so that it was not saved
//
// test/registry/descriptors.test.js, test/device/discovery.test.js and test/dispatch/interfaces.test.js run the
// entries. The first one fails for a descriptor of tier 1 or 2 that has no entry.
@ -108,6 +110,59 @@ module.exports = [
}],
},
{ namespace: "Alexa.TemperatureSensor", page: "alexa-temperaturesensor", declared: [{ options: reported, example: "discovery" }] },
{
namespace: "Alexa.ThermostatController",
page: "alexa-thermostatcontroller",
chosen: true,
declared: [
{
example: "discovery",
options: {
...reported,
supportedModes: ["HEAT", "COOL", "AUTO", "EM_HEAT"],
supportsScheduling: true,
properties: ["lowerSetpoint", "upperSetpoint", "thermostatMode", "adaptiveRecoveryStatus"],
},
},
{
page: "alexa-thermostatcontroller-schedule",
example: "discovery",
options: { ...reported, supportedModes: ["HEAT", "COOL", "AUTO", "OFF"], supportsScheduling: true, properties: ["thermostatMode"] },
},
],
refused: [
["SetTargetTemperature", { targetSetpoint: { value: 20, scale: "RANKINE" } }, 'payload.targetSetpoint.scale: expected CELSIUS | FAHRENHEIT | KELVIN, got "RANKINE"'],
[
"SetTargetTemperature",
{ holdUntil: { duration: "PT30M" } },
'payload: expected one or more of targetSetpoint, lowerSetpoint, upperSetpoint, got {"holdUntil":{"duration":"PT30M"}}',
],
[
"SetTargetTemperature",
{ targetSetpoint: { value: 20, scale: "CELSIUS" }, holdUntil: { duration: "30 minutes" } },
'payload.holdUntil.duration: expected a duration like PT3M15S, got "30 minutes"',
],
["AdjustTargetTemperature", { targetSetpointDelta: 2 }, "payload.targetSetpointDelta: expected an object with value, scale, got 2"],
["SetThermostatMode", { thermostatMode: { value: "WARM" } }, 'payload.thermostatMode.value: expected AUTO | COOL | ECO | EM_HEAT | HEAT | OFF, got "WARM"'],
["SetThermostatMode", { thermostatMode: "HEAT" }, 'payload.thermostatMode: expected an object with value, got "HEAT"'],
],
unfit: [["thermostatMode", "EMERGENCY"], ["targetSetpoint", 20], ["upperSetpoint", { value: 20 }], ["adaptiveRecoveryStatus", "ACTIVE"]],
},
{
namespace: "Alexa.ThermostatController.Schedule",
page: "alexa-thermostatcontroller-schedule",
folded: ["SetWeeklySchedule"],
declared: [{
example: "discovery",
options: { ...reported, supportedFanModes: ["ON", "AUTO"], supportsAdaptiveRecovery: true, maxEntryPerDay: 4 },
}],
refused: [
["SetScheduleState", { scheduleEnabled: "yes" }, 'payload.scheduleEnabled: expected true or false, got "yes"'],
["SetAdaptiveRecovery", {}, "payload.adaptiveRecoveryEnabled: expected true or false, got nothing"],
["SetWeeklySchedule", { weeklySchedule: { temperatureScale: "CELSIUS" } }, "payload.weeklySchedule.Monday: expected a list, got nothing"],
],
unfit: [["scheduleEnabled", "ON"], ["adaptiveRecoveryEnabled", 1]],
},
{
namespace: "Alexa.ToggleController",
page: "alexa-togglecontroller",