Skip to content

Commit ba7c499

Browse files
committed
TC-VALCC-4.2: unconditionally write open duration
This way we can ensure the open duration is writeable. Also add a cleanup step.
1 parent f509f67 commit ba7c499

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/python_testing/TC_VALCC_4_2.py

+7-8
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ def steps_TC_VALCC_4_2(self) -> list[TestStep]:
5555
TestStep(8, "Send Close command"),
5656
TestStep(9, "Read OpenDuration attribute"),
5757
TestStep(10, "Read RemainingDuration attribute"),
58+
TestStep(11, "Write DefaultOpenDuration back to original value")
5859
]
5960
return steps
6061

@@ -73,16 +74,11 @@ async def test_TC_VALCC_4_2(self):
7374
attributes = Clusters.ValveConfigurationAndControl.Attributes
7475

7576
self.step("2a")
76-
defaultOpenDuration = await self.read_valcc_attribute_expect_success(endpoint=endpoint, attribute=attributes.DefaultOpenDuration)
77+
originalDefaultOpenDuration = await self.read_valcc_attribute_expect_success(endpoint=endpoint, attribute=attributes.DefaultOpenDuration)
7778

7879
self.step("2b")
79-
if defaultOpenDuration is NullValue:
80-
defaultOpenDuration = 60
81-
82-
result = await self.default_controller.WriteAttribute(self.dut_node_id, [(endpoint, attributes.DefaultOpenDuration(defaultOpenDuration))])
83-
asserts.assert_equal(result[0].Status, Status.Success, "DefaultOpenDuration write failed")
84-
else:
85-
logging.info("Test step skipped")
80+
defaultOpenDuration = 60
81+
await self.write_single_attribute(attributes.DefaultOpenDuration(defaultOpenDuration))
8682

8783
self.step(3)
8884
try:
@@ -129,6 +125,9 @@ async def test_TC_VALCC_4_2(self):
129125
remaining_duration_dut = await self.read_valcc_attribute_expect_success(endpoint=endpoint, attribute=attributes.RemainingDuration)
130126
asserts.assert_true(remaining_duration_dut is NullValue, "RemainingDuration is not null")
131127

128+
self.step(11)
129+
await self.write_single_attribute(attributes.DefaultOpenDuration(originalDefaultOpenDuration))
130+
132131

133132
if __name__ == "__main__":
134133
default_matter_test_main()

0 commit comments

Comments
 (0)