Skip to content

Commit 545114a

Browse files
committed
Fix logic of legacy devices and remove comments
1 parent 2d1f43f commit 545114a

File tree

1 file changed

+7
-20
lines changed

1 file changed

+7
-20
lines changed

src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py

+7-20
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ class MatterTestConfig:
609609
# path to device attestation revocation set json file
610610
dac_revocation_set_path: Optional[pathlib.Path] = None
611611

612-
legacy: Optional[bool] = None
612+
legacy: bool = False
613613

614614

615615
class ClusterMapper:
@@ -1224,26 +1224,17 @@ async def send_test_event_triggers(self, eventTrigger: int, enableKey: bytes = N
12241224
else:
12251225
enableKey = self.matter_test_config.global_test_params['enableKey']
12261226

1227-
# What about --endpoing != 0 and legacy = True? Right now target endpoint is set to 0
1228-
12291227
target_endpoint = 0
1230-
if not self.matter_test_config.legacy and self.matter_test_config.endpoint is not None:
1231-
target_endpoint = self.matter_test_config.endpoint
1232-
1233-
print("")
1234-
print("Target endpoint: ", target_endpoint)
1235-
print("")
12361228

1237-
print("")
1238-
print("Event trigger: ", hex(eventTrigger))
1239-
print("")
1229+
if self.matter_test_config.legacy:
1230+
logger.info("Legacy test event trigger activated")
1231+
else:
1232+
logger.info("Legacy test event trigger deactivated")
1233+
target_endpoint = self.get_endpoint()
12401234

1235+
# Sets endpoint in eventTrigger
12411236
eventTrigger = eventTrigger | (target_endpoint << 32)
12421237

1243-
print("")
1244-
print("Event trigger: ", hex(eventTrigger))
1245-
print("")
1246-
12471238
try:
12481239
# GeneralDiagnostics cluster is meant to be on Endpoint 0 (Root)
12491240
general_diagnostics_result = await self.send_single_cmd(endpoint=0,
@@ -1252,10 +1243,6 @@ async def send_test_event_triggers(self, eventTrigger: int, enableKey: bytes = N
12521243
eventTrigger)
12531244
)
12541245

1255-
print("")
1256-
logger.info(general_diagnostics_result)
1257-
print("")
1258-
12591246
except InteractionModelError as e:
12601247
asserts.fail(
12611248
f"Sending TestEventTrigger resulted in Unexpected error. Are they enabled in DUT? Command returned - {e.status}")

0 commit comments

Comments
 (0)