Skip to content

Commit

Permalink
Align thermostat cluster better with the spec. (#18594)
Browse files Browse the repository at this point in the history
Specific changes:

* Adjust names of attributes to match the spec.
* Mark the attributes that are supposed to be nullable as nullable.
* Make the min values be decimal for various attributes, for readability.
* Add the various setback attributes and EmergencyHeatDelta.
* Fix incorrect fourth field for SetWeeklySchedule and
  GetWeeklyScheduleResponse.
* Fix the types for the NumberOfTransitionsForSequence fields in
  SetWeeklySchedule and GetWeeklyScheduleResponse.
* Fix incorrect type of RelayStatus in GetRelayStatusLogResponse.

https://github.com/CHIP-Specifications/connectedhomeip-spec/issues/5238
tracks the outstanding spec issue about the fields of the
ThermostatScheduleTransition struct.

Fixes #11670
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed May 27, 2022
1 parent d22a523 commit 8362564
Show file tree
Hide file tree
Showing 53 changed files with 4,602 additions and 1,629 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3339,7 +3339,13 @@ server cluster Thermostat = 513 {
kAutomode = 0x20;
}

readonly attribute int16s localTemperature = 0;
struct ThermostatScheduleTransition {
int16u transitionTime = 0;
nullable int16s heatSetpoint = 1;
nullable int16s coolSetpoint = 2;
}

readonly attribute nullable int16s localTemperature = 0;
readonly attribute int16s absMinHeatSetpointLimit = 3;
readonly attribute int16s absMaxHeatSetpointLimit = 4;
readonly attribute int16s absMinCoolSetpointLimit = 5;
Expand Down
8 changes: 7 additions & 1 deletion examples/placeholder/linux/apps/app1/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -2302,7 +2302,13 @@ server cluster Thermostat = 513 {
kAutomode = 0x20;
}

readonly attribute int16s localTemperature = 0;
struct ThermostatScheduleTransition {
int16u transitionTime = 0;
nullable int16s heatSetpoint = 1;
nullable int16s coolSetpoint = 2;
}

readonly attribute nullable int16s localTemperature = 0;
readonly attribute int16s absMinHeatSetpointLimit = 3;
readonly attribute int16s absMinCoolSetpointLimit = 5;
readonly attribute int16s absMaxCoolSetpointLimit = 6;
Expand Down
8 changes: 7 additions & 1 deletion examples/placeholder/linux/apps/app2/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -2302,7 +2302,13 @@ server cluster Thermostat = 513 {
kAutomode = 0x20;
}

readonly attribute int16s localTemperature = 0;
struct ThermostatScheduleTransition {
int16u transitionTime = 0;
nullable int16s heatSetpoint = 1;
nullable int16s coolSetpoint = 2;
}

readonly attribute nullable int16s localTemperature = 0;
readonly attribute int16s absMinHeatSetpointLimit = 3;
readonly attribute int16s absMinCoolSetpointLimit = 5;
readonly attribute int16s absMaxCoolSetpointLimit = 6;
Expand Down
18 changes: 12 additions & 6 deletions examples/thermostat/thermostat-common/thermostat.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,13 @@ server cluster Thermostat = 513 {
kAutomode = 0x20;
}

readonly attribute int16s localTemperature = 0;
struct ThermostatScheduleTransition {
int16u transitionTime = 0;
nullable int16s heatSetpoint = 1;
nullable int16s coolSetpoint = 2;
}

readonly attribute nullable int16s localTemperature = 0;
readonly attribute int16s absMinHeatSetpointLimit = 3;
readonly attribute int16s absMaxHeatSetpointLimit = 4;
readonly attribute int16s absMinCoolSetpointLimit = 5;
Expand All @@ -1068,10 +1074,10 @@ server cluster Thermostat = 513 {
}

request struct SetWeeklyScheduleRequest {
ENUM8 numberOfTransitionsForSequence = 0;
INT8U numberOfTransitionsForSequence = 0;
DayOfWeek dayOfWeekForSequence = 1;
ModeForSequence modeForSequence = 2;
INT8U payload[] = 3;
ThermostatScheduleTransition transitions[] = 3;
}

request struct GetWeeklyScheduleRequest {
Expand All @@ -1080,15 +1086,15 @@ server cluster Thermostat = 513 {
}

response struct GetWeeklyScheduleResponse = 0 {
ENUM8 numberOfTransitionsForSequence = 0;
INT8U numberOfTransitionsForSequence = 0;
DayOfWeek dayOfWeekForSequence = 1;
ModeForSequence modeForSequence = 2;
INT8U payload[] = 3;
ThermostatScheduleTransition transitions[] = 3;
}

response struct GetRelayStatusLogResponse = 1 {
INT16U timeOfDay = 0;
BITMAP16 relayStatus = 1;
BITMAP8 relayStatus = 1;
INT16S localTemperature = 2;
INT8U humidityInPercentage = 3;
INT16S setpoint = 4;
Expand Down
34 changes: 17 additions & 17 deletions src/app/tests/suites/certification/Test_TC_TSTAT_2_1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ tests:
- label:
"Reads constraints of mandatory attributes from DUT: LocalTemperature"
command: "readAttribute"
attribute: "local temperature"
attribute: "LocalTemperature"
response:
constraints:
type: int16
Expand All @@ -42,7 +42,7 @@ tests:
"Reads constraints of mandatory attributes from DUT:
AbsMinHeatSetpointLimit"
command: "readAttribute"
attribute: "abs min heat setpoint limit"
attribute: "AbsMinHeatSetpointLimit"
response:
constraints:
type: int16
Expand All @@ -53,7 +53,7 @@ tests:
"Reads constraints of mandatory attributes from DUT:
AbsMaxHeatSetpointLimit"
command: "readAttribute"
attribute: "abs max heat setpoint limit"
attribute: "AbsMaxHeatSetpointLimit"
response:
constraints:
type: int16
Expand All @@ -65,7 +65,7 @@ tests:
AbsMinCoolSetpointLimit"
optional: true
command: "readAttribute"
attribute: "abs min cool setpoint limit"
attribute: "AbsMinCoolSetpointLimit"
response:
constraints:
type: int16
Expand All @@ -77,7 +77,7 @@ tests:
AbsMaxCoolSetpointLimit"
optional: true
command: "readAttribute"
attribute: "abs max cool setpoint limit"
attribute: "AbsMaxCoolSetpointLimit"
response:
constraints:
type: int16
Expand Down Expand Up @@ -111,7 +111,7 @@ tests:
OccupiedCoolingSetpoint"
optional: true
command: "readAttribute"
attribute: "occupied cooling setpoint"
attribute: "OccupiedCoolingSetpoint"
response:
constraints:
type: int16
Expand All @@ -122,7 +122,7 @@ tests:
"Reads constraints of mandatory attributes from DUT:
OccupiedHeatingSetpoint"
command: "readAttribute"
attribute: "occupied heating setpoint"
attribute: "OccupiedHeatingSetpoint"
response:
constraints:
type: int16
Expand Down Expand Up @@ -157,7 +157,7 @@ tests:
"Reads constraints of mandatory attributes from DUT:
MinHeatSetpointLimit"
command: "readAttribute"
attribute: "min heat setpoint limit"
attribute: "MinHeatSetpointLimit"
response:
constraints:
type: int16
Expand All @@ -168,7 +168,7 @@ tests:
"Reads constraints of mandatory attributes from DUT:
MaxHeatSetpointLimit"
command: "readAttribute"
attribute: "max heat setpoint limit"
attribute: "MaxHeatSetpointLimit"
response:
constraints:
type: int16
Expand All @@ -180,7 +180,7 @@ tests:
MinCoolSetpointLimit"
optional: true
command: "readAttribute"
attribute: "min cool setpoint limit"
attribute: "MinCoolSetpointLimit"
response:
constraints:
type: int16
Expand All @@ -192,7 +192,7 @@ tests:
MaxCoolSetpointLimit"
optional: true
command: "readAttribute"
attribute: "max cool setpoint limit"
attribute: "MaxCoolSetpointLimit"
response:
constraints:
type: int16
Expand All @@ -203,7 +203,7 @@ tests:
"Reads constraints of mandatory attributes from DUT:
ControlSequenceOfOperation"
command: "readAttribute"
attribute: "control sequence of operation"
attribute: "ControlSequenceOfOperation"
response:
constraints:
type: enum8
Expand All @@ -212,7 +212,7 @@ tests:

- label: "Reads constraints of mandatory attributes from DUT: SystemMode"
command: "readAttribute"
attribute: "system mode"
attribute: "SystemMode"
response:
constraints:
type: enum8
Expand Down Expand Up @@ -267,7 +267,7 @@ tests:
MinSetpointDeadBand"
optional: true
command: "readAttribute"
attribute: "min setpoint dead band"
attribute: "MinSetpointDeadBand"
response:
constraints:
type: int8
Expand Down Expand Up @@ -309,7 +309,7 @@ tests:
- label: "Reads constraints of optional attributes from DUT: StartOfWeek"
optional: true
command: "readAttribute"
attribute: "start of week"
attribute: "StartOfWeek"
response:
constraints:
type: enum8
Expand All @@ -321,7 +321,7 @@ tests:
NumberOfWeeklyTransitions"
optional: true
command: "readAttribute"
attribute: "number of weekly transitions"
attribute: "NumberOfWeeklyTransitions"
response:
constraints:
type: uint8
Expand All @@ -331,7 +331,7 @@ tests:
NumberOfDailyTransitions"
optional: true
command: "readAttribute"
attribute: "number of daily transitions"
attribute: "NumberOfDailyTransitions"
response:
constraints:
type: uint8
Expand Down
Loading

0 comments on commit 8362564

Please sign in to comment.