Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test scripts for testing Presets attributes and commands for Thermostat cluster #34614

Merged
merged 10 commits into from
Jul 31, 2024
1 change: 1 addition & 0 deletions examples/thermostat/thermostat-common/thermostat.matter
Original file line number Diff line number Diff line change
Expand Up @@ -2539,6 +2539,7 @@ endpoint 1 {
ram attribute absMaxHeatSetpointLimit default = 3000;
ram attribute absMinCoolSetpointLimit default = 1600;
ram attribute absMaxCoolSetpointLimit default = 3200;
ram attribute localTemperatureCalibration default = 0x00;
persist attribute occupiedCoolingSetpoint default = 0x0A28;
persist attribute occupiedHeatingSetpoint default = 0x07D0;
ram attribute minHeatSetpointLimit default = 700;
Expand Down
16 changes: 16 additions & 0 deletions examples/thermostat/thermostat-common/thermostat.zap
Original file line number Diff line number Diff line change
Expand Up @@ -4774,6 +4774,22 @@
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "LocalTemperatureCalibration",
"code": 16,
"mfgCode": null,
"side": "server",
"type": "int8s",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x00",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "OccupiedCoolingSetpoint",
"code": 17,
Expand Down
50 changes: 50 additions & 0 deletions src/app/tests/suites/certification/PICS.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6419,6 +6419,21 @@ PICS:
- label: "Does the device implement the ACCapacityFormat attribute?"
id: TSTAT.S.A0047

- label: "Does the device implement the PresetTypes attribute?"
id: TSTAT.S.A0048

- label: "Does the device implement the NumberOfPresets attribute?"
id: TSTAT.S.A004a

- label: "Does the device implement the ActivePresetHandle attribute?"
id: TSTAT.S.A004e

- label: "Does the device implement the Presets attribute?"
id: TSTAT.S.A0050

- label: "Does the device implement the PresetsSchedulesEditable attribute?"
id: TSTAT.S.A0052

#
# server / commandsReceived
#
Expand All @@ -6442,6 +6457,22 @@ PICS:
"Does the device implement receiving the GetRelayStatusLog command?"
id: TSTAT.S.C04.Rsp

- label:
"Does the device implement receiving the SetActivePresetRequest command?"
id: TSTAT.S.C06.Rsp

- label:
"Does the device implement receiving the StartPresetsSchedulesEditRequest command?"
id: TSTAT.S.C07.Rsp

- label:
"Does the device implement receiving the CancelPresetsSchedulesEditRequest command?"
id: TSTAT.S.C08.Rsp

- label:
"Does the device implement receiving the CommitPresetsSchedulesRequest command?"
id: TSTAT.S.C09.Rsp

#
# server / commandsGenerated
#
Expand Down Expand Up @@ -6479,6 +6510,9 @@ PICS:
- label: "Supports a local temperature not exposed"
id: TSTAT.S.F06

- label: "Supports setpoint presets"
id: TSTAT.S.F08

#
# server / manually
#
Expand Down Expand Up @@ -6520,6 +6554,22 @@ PICS:
- label: "Does the device implement sending the GetRelayStatusLog command?"
id: TSTAT.C.C04.Tx

- label:
"Does the device implement sending the SetActivePresetRequest command?"
id: TSTAT.C.C06.Tx

- label:
"Does the device implement sending the StartPresetsSchedulesEditRequest command?"
id: TSTAT.C.C07.Tx

- label:
"Does the device implement sending the CancelPresetsSchedulesEditRequest command?"
id: TSTAT.C.C08.Tx

- label:
"Does the device implement sending the CommitPresetsSchedulesRequest command?"
id: TSTAT.C.C09.Tx

#
# client / manually
#
Expand Down
32 changes: 32 additions & 0 deletions src/app/tests/suites/certification/Test_TC_TSTAT_1_1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,17 @@ tests:
type: bitmap32
hasMasksSet: [0x40]

- label:
"Step 3i: Given TSTAT.S.F08(PRES ensure featuremap has the correct bit
set"
PICS: TSTAT.S.F08
command: "readAttribute"
attribute: "FeatureMap"
response:
constraints:
type: bitmap32
hasMasksSet: [0x100]

- label: "Step 4a: TH reads from the DUT the AttributeList attribute."
PICS: PICS_EVENT_LIST_ENABLED
command: "readAttribute"
Expand Down Expand Up @@ -555,6 +566,17 @@ tests:
type: list
contains: [30]

- label:
"Step 4j: TH reads the Feature dependent(TSTAT.S.F08(PRES) attribute
in AttributeList"
PICS: TSTAT.S.F08
command: "readAttribute"
attribute: "AttributeList"
response:
constraints:
type: list
contains: [72, 74, 78, 80, 82]

- label: "Step 5: TH reads EventList attribute from the DUT."
PICS: PICS_EVENT_LIST_ENABLED
command: "readAttribute"
Expand Down Expand Up @@ -593,6 +615,16 @@ tests:
constraints:
type: list
contains: [4]
- label:
"Step 6d: TH reads Feature dependent(TSTAT.S.F08(PRES)) commands in
AcceptedCommandList"
PICS: TSTAT.S.F08
command: "readAttribute"
attribute: "AcceptedCommandList"
response:
constraints:
type: list
contains: [6, 7, 8, 9]

- label:
"Step 7a: TH reads from the DUT the GeneratedCommandList attribute."
Expand Down
117 changes: 117 additions & 0 deletions src/app/tests/suites/certification/Test_TC_TSTAT_4_1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# Copyright (c) 2024 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: 42.4.1. [TC-TSTAT-4.1] Preset attributes with server as DUT

PICS:
- TSTAT.S

config:
nodeId: 0x12344321
cluster: "Thermostat"
endpoint: 1

tests:
- label: "Step 1: Commission DUT to TH"
cluster: "DelayCommands"
command: "WaitForCommissionee"
arguments:
values:
- name: "nodeId"
value: nodeId

- label:
"Saving value for comparision in step 2 read
PresetTypes attribute"
PICS: TSTAT.S.A0048
command: "readAttribute"
attribute: "PresetTypes"
response:
saveAs: PresetTypesValue

- label:
"Saving value for comparision in step 3 read
NumberOfPresets attribute"
PICS: TSTAT.S.A004a
command: "readAttribute"
attribute: "NumberOfPresets"
response:
saveAs: NumberOfPresetsValue

- label:
"Saving value for comparision in step 4 read
ActivePresetHandleValue attribute"
PICS: TSTAT.S.A004e
command: "readAttribute"
attribute: "ActivePresetHandle"
response:
saveAs: ActivePresetHandleValue

- label:
"Saving value for comparision in step 5 read
Presets attribute"
PICS: TSTAT.S.A0050
command: "readAttribute"
attribute: "Presets"
response:
saveAs: PresetsValue

- label:
"Saving value for comparision in step 6 read
PresetsSchedulesEditable attribute"
PICS: TSTAT.S.A0052
command: "readAttribute"
attribute: "PresetsSchedulesEditable"
response:
saveAs: PresetsSchedulesEditableValue

- label: "Step 2: TH reads the PresetTypes attribute from the DUT"
PICS: TSTAT.S.F08 & TSTAT.S.A0048
command: "readAttribute"
attribute: "PresetTypes"
response:
constraints:
type: list

- label: "Step 3: TH reads the NumberOfPresets attribute from the DUT"
PICS: TSTAT.S.F08 & TSTAT.S.A004a
command: "readAttribute"
attribute: "NumberOfPresets"
response:
constraints:
type: int8u

- label: "Step 4: TH reads the ActivePresetHandle attribute from the DUT"
PICS: TSTAT.S.F08 & TSTAT.S.A004e
command: "readAttribute"
attribute: "ActivePresetHandle"
response:
constraints:
type: octstr

- label: "Step 5: TH reads the Presets attribute from the DUT"
PICS: TSTAT.S.F08 & TSTAT.S.A0050
command: "readAttribute"
attribute: "Presets"
response:
constraints:
type: list

- label: "Step 6: TH reads the PresetsSchedulesEditable attribute from the DUT"
PICS: TSTAT.S.F08 & TSTAT.S.A0052
command: "readAttribute"
attribute: "PresetsSchedulesEditable"
response:
constraints:
type: boolean
Loading
Loading