@@ -55,6 +55,7 @@ def steps_TC_VALCC_4_2(self) -> list[TestStep]:
55
55
TestStep (8 , "Send Close command" ),
56
56
TestStep (9 , "Read OpenDuration attribute" ),
57
57
TestStep (10 , "Read RemainingDuration attribute" ),
58
+ TestStep (11 , "Write DefaultOpenDuration back to original value" )
58
59
]
59
60
return steps
60
61
@@ -73,16 +74,11 @@ async def test_TC_VALCC_4_2(self):
73
74
attributes = Clusters .ValveConfigurationAndControl .Attributes
74
75
75
76
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 )
77
78
78
79
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 ))
86
82
87
83
self .step (3 )
88
84
try :
@@ -129,6 +125,9 @@ async def test_TC_VALCC_4_2(self):
129
125
remaining_duration_dut = await self .read_valcc_attribute_expect_success (endpoint = endpoint , attribute = attributes .RemainingDuration )
130
126
asserts .assert_true (remaining_duration_dut is NullValue , "RemainingDuration is not null" )
131
127
128
+ self .step (11 )
129
+ await self .write_single_attribute (attributes .DefaultOpenDuration (originalDefaultOpenDuration ))
130
+
132
131
133
132
if __name__ == "__main__" :
134
133
default_matter_test_main ()
0 commit comments