@@ -157,7 +157,7 @@ def steps_TC_CLCTRL_4_3(self) -> list[TestStep]:
157
157
"Receive CONSTRAINT_ERROR response from the DUT" ),
158
158
TestStep ("7d" , "If the SP feature is supported, send MoveTo command with Position = MoveToFullyClosed and Speed = 4" ,
159
159
"Receive CONSTRAINT_ERROR response from the DUT" ),
160
- TestStep ("8a" , "Check LT feature support" , "Skip steps 8b to 8h if the LT feature is not supported" ),
160
+ TestStep ("8a" , "Check LT feature support" , "Skip steps 8b to 8j if the LT feature is not supported" ),
161
161
TestStep ("8b" , "Read the OverallCurrentState attribute" ,
162
162
"OverallCurrentState of the ClosureControl cluster is returned by the DUT; Latching field is saved as CurrentLatch" ),
163
163
TestStep ("8c" , "Preparing Latch-State: If CurrentLatch is True and LatchControlModes Bit 0 = 1, skip step 8d" ),
@@ -166,9 +166,12 @@ def steps_TC_CLCTRL_4_3(self) -> list[TestStep]:
166
166
TestStep ("8e" , "If CurrentLatch is False and LatchControlModes Bit 1 = 1, skip step 8f" ),
167
167
TestStep ("8f" , "Send MoveTo command with Latch = CurrentLatch" ,
168
168
"Receive INVALID_IN_STATE response from the DUT" ),
169
- TestStep ("8g" , "If LatchControlModes Bit 1 = 0 or LatchControlModes Bit 0 = 0, skip step 8h" ),
169
+ TestStep ("8g" , "If CurrentLatch is True and LatchControlModes Bit 0 = 0, skip step 8h" ),
170
170
TestStep ("8h" , "Send MoveTo command with Latch = CurrentLatch" ,
171
171
"Receive SUCCESS response from the DUT" ),
172
+ TestStep ("8i" , "If CurrentLatch is False and LatchControlModes Bit 1 = 0, skip step 8j" ),
173
+ TestStep ("8j" , "Send MoveTo command with Latch = CurrentLatch" ,
174
+ "Receive SUCCESS response from the DUT" ),
172
175
TestStep ("9a" , "Check PS feature support" , "Skip steps 9b and 9c if the PS feature is not supported" ),
173
176
TestStep ("9b" , "Read the OverallCurrentState attribute" ,
174
177
"OverallCurrentState of the ClosureControl cluster is returned by the DUT; Position field is saved as CurrentPosition" ),
@@ -547,7 +550,7 @@ async def test_TC_CLCTRL_4_3(self):
547
550
f"Expected InvalidInState status for MoveTo with Latch = { current_latch } , but got: { e } " )
548
551
549
552
self .step ("8g" )
550
- if not latch_control_modes & Clusters . ClosureControl . Bitmaps . LatchControlModesBitmap . kRemoteUnlatching or not latch_control_modes & Clusters .ClosureControl .Bitmaps .LatchControlModesBitmap .kRemoteLatching :
553
+ if current_latch and not ( latch_control_modes & Clusters .ClosureControl .Bitmaps .LatchControlModesBitmap .kRemoteLatching ) :
551
554
self .skip_step ("8h" )
552
555
else :
553
556
self .step ("8h" )
@@ -558,11 +561,24 @@ async def test_TC_CLCTRL_4_3(self):
558
561
logging .error (f"MoveTo command with Latch = { current_latch } failed: { e } " )
559
562
asserts .assert_equal (e .status , Status .Success ,
560
563
f"Expected Success status for MoveTo with Latch = { current_latch } , but got: { e } " )
564
+
565
+ self .step ("8i" )
566
+ if not current_latch and not (latch_control_modes & Clusters .ClosureControl .Bitmaps .LatchControlModesBitmap .kRemoteUnlatching ):
567
+ self .skip_step ("8j" )
568
+ else :
569
+ self .step ("8j" )
570
+ try :
571
+ await self .send_single_cmd (endpoint = endpoint , cmd = Clusters .ClosureControl .Commands .MoveTo (latch = current_latch ), timedRequestTimeoutMs = 1000 )
572
+ logging .info (f"MoveTo command with Latch = { current_latch } sent successfully" )
573
+ except InteractionModelError as e :
574
+ logging .error (f"MoveTo command with Latch = { current_latch } failed: { e } " )
575
+ asserts .assert_equal (e .status , Status .Success ,
576
+ f"Expected Success status for MoveTo with Latch = { current_latch } , but got: { e } " )
561
577
sub_handler .reset ()
562
578
563
579
else :
564
- logging .info ("Skipping steps 8b to 8h as Latching feature is not supported" )
565
- self .mark_step_range_skipped ("8b" , "8h " )
580
+ logging .info ("Skipping steps 8b to 8j as Latching feature is not supported" )
581
+ self .mark_step_range_skipped ("8b" , "8j " )
566
582
567
583
self .step ("9a" )
568
584
if is_position_supported :
0 commit comments