@@ -52,8 +52,13 @@ def pics_TC_TCTL_2_3(self):
52
52
def steps_TC_TCTL_2_3 (self ) -> list [TestStep ]:
53
53
steps = [
54
54
TestStep (1 , "Commissioning, already done" , is_commissioning = True ),
55
- TestStep (2 , "TH reads from the DUT the SelectedTemperatureLevel attribute" ),
56
- TestStep (3 , "TH reads from the DUT the SupportedTemperatureLevels attribute and verifies string lengths" ),
55
+ TestStep (2 , "TH reads from the DUT the SelectedTemperatureLevel attribute" ,
56
+ "Verify that the DUT response contains the value of _SelectedTemperatureLevel_ with a range of 0 to 31" ),
57
+ TestStep (3 , "TH reads from the DUT the SupportedTemperatureLevels attribute and verifies string lengths" ,
58
+ ("Verify that the DUT response contains a _SupportedTemperatureLevels_ list\n \n "
59
+ "* List length hast to be equal or less than 32 \n "
60
+ "* Each temperature level should be a string\n "
61
+ "* Length of each temperature level string should be equal or less than 16\n " )),
57
62
]
58
63
return steps
59
64
@@ -66,32 +71,30 @@ async def test_TC_TCTL_2_3(self):
66
71
67
72
# Step 2: Read SelectedTemperatureLevel attribute
68
73
self .step (2 )
69
- if self .attribute_guard (endpoint = self .endpoint , attribute = attributes .SelectedTemperatureLevel ):
70
- selected_temp = await self .read_single_attribute_check_success (
71
- cluster = cluster ,
72
- attribute = cluster .Attributes .SelectedTemperatureLevel
73
- )
74
- asserts .assert_true (0 <= selected_temp <= 31 ,
75
- f"SelectedTemperatureLevel { selected_temp } is out of range [0-31]" )
74
+ selected_temp = await self .read_single_attribute_check_success (
75
+ cluster = cluster ,
76
+ attribute = attributes .SelectedTemperatureLevel
77
+ )
78
+ asserts .assert_true (0 <= selected_temp <= 31 ,
79
+ f"SelectedTemperatureLevel { selected_temp } is out of range [0-31]" )
76
80
77
81
# Step 3: Read SupportedTemperatureLevels attribute
78
82
self .step (3 )
79
- if self .attribute_guard (endpoint = self .endpoint , attribute = attributes .SupportedTemperatureLevels ):
80
- supported_temps = await self .read_single_attribute_check_success (
81
- cluster = cluster ,
82
- attribute = cluster .Attributes .SupportedTemperatureLevels
83
- )
84
- asserts .assert_true (isinstance (supported_temps , list ),
85
- "SupportedTemperatureLevels should be a list" )
86
- asserts .assert_true (len (supported_temps ) <= 32 ,
87
- f"SupportedTemperatureLevels list length { len (supported_temps )} exceeds maximum of 32" )
83
+ supported_temps = await self .read_single_attribute_check_success (
84
+ cluster = cluster ,
85
+ attribute = attributes .SupportedTemperatureLevels
86
+ )
87
+ asserts .assert_true (isinstance (supported_temps , list ),
88
+ "SupportedTemperatureLevels should be a list" )
89
+ asserts .assert_true (len (supported_temps ) <= 32 ,
90
+ f"SupportedTemperatureLevels list length { len (supported_temps )} exceeds maximum of 32" )
88
91
89
- # Verify string lengths
90
- for level in supported_temps :
91
- asserts .assert_true (isinstance (level , str ),
92
- f"Temperature level { level } is not a string" )
93
- asserts .assert_true (len (level ) <= 16 ,
94
- f"Temperature level string '{ level } ' exceeds maximum length of 16" )
92
+ # Verify string lengths
93
+ for level in supported_temps :
94
+ asserts .assert_true (isinstance (level , str ),
95
+ f"Temperature level { level } is not a string" )
96
+ asserts .assert_true (len (level ) <= 16 ,
97
+ f"Temperature level string '{ level } ' exceeds maximum length of 16" )
95
98
96
99
97
100
if __name__ == "__main__" :
0 commit comments