|
| 1 | +# Copyright (c) 2024 Project CHIP Authors |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +name: Thermostat basic functionality tests |
| 16 | + |
| 17 | +config: |
| 18 | + nodeId: 0x12344321 |
| 19 | + cluster: "Thermostat" |
| 20 | + endpoint: 1 |
| 21 | + |
| 22 | +tests: |
| 23 | + - label: "Wait for the commissioned device to be retrieved" |
| 24 | + cluster: "DelayCommands" |
| 25 | + command: "WaitForCommissionee" |
| 26 | + arguments: |
| 27 | + values: |
| 28 | + - name: "nodeId" |
| 29 | + value: nodeId |
| 30 | + |
| 31 | + - label: "Read current SystemMode value" |
| 32 | + command: "readAttribute" |
| 33 | + attribute: "SystemMode" |
| 34 | + response: |
| 35 | + saveAs: originalSystemMode |
| 36 | + |
| 37 | + - label: "Try to set SystemMode to Sleep" |
| 38 | + command: "writeAttribute" |
| 39 | + attribute: "SystemMode" |
| 40 | + arguments: |
| 41 | + value: SystemModeEnum.Sleep |
| 42 | + |
| 43 | + - label: "Check that the new value is set now" |
| 44 | + command: "readAttribute" |
| 45 | + attribute: "SystemMode" |
| 46 | + response: |
| 47 | + value: SystemModeEnum.Sleep |
| 48 | + |
| 49 | + - label: "Try to set SystemMode to an invalid value" |
| 50 | + # Have to use WriteById, because normal write enforces valid values for enums. |
| 51 | + cluster: "AnyCommands" |
| 52 | + command: "WriteById" |
| 53 | + attribute: "SystemMode" |
| 54 | + arguments: |
| 55 | + values: |
| 56 | + - name: "ClusterId" |
| 57 | + value: 0x0201 # Thermostat |
| 58 | + - name: "AttributeId" |
| 59 | + value: 0x001C # SystemMode |
| 60 | + - name: "Value" |
| 61 | + # Note: At some point this might become a valid value, |
| 62 | + # and then this test will need to be adjusted, but that |
| 63 | + # seems fairly low-probability. |
| 64 | + value: 254 |
| 65 | + response: |
| 66 | + error: CONSTRAINT_ERROR |
| 67 | + |
| 68 | + - label: "Verify that WriteById would work correctly with a valid value" |
| 69 | + cluster: "AnyCommands" |
| 70 | + command: "WriteById" |
| 71 | + attribute: "SystemMode" |
| 72 | + arguments: |
| 73 | + values: |
| 74 | + - name: "ClusterId" |
| 75 | + value: 0x0201 # Thermostat |
| 76 | + - name: "AttributeId" |
| 77 | + value: 0x001C # SystemMode |
| 78 | + - name: "Value" |
| 79 | + value: 8 # SystemModeEnum.Dry |
| 80 | + |
| 81 | + - label: "Check that the new value is set by id" |
| 82 | + command: "readAttribute" |
| 83 | + attribute: "SystemMode" |
| 84 | + response: |
| 85 | + value: SystemModeEnum.Dry |
| 86 | + |
| 87 | + - label: "reset SystemMode to original value" |
| 88 | + command: "writeAttribute" |
| 89 | + attribute: "SystemMode" |
| 90 | + arguments: |
| 91 | + value: originalSystemMode |
0 commit comments