diff --git a/scripts/py_matter_yamltests/matter_yamltests/pseudo_clusters/clusters/log_commands.py b/scripts/py_matter_yamltests/matter_yamltests/pseudo_clusters/clusters/log_commands.py index e46f2184fad3b4..4a98c3cb84f85f 100644 --- a/scripts/py_matter_yamltests/matter_yamltests/pseudo_clusters/clusters/log_commands.py +++ b/scripts/py_matter_yamltests/matter_yamltests/pseudo_clusters/clusters/log_commands.py @@ -39,12 +39,17 @@ class LogCommands(PseudoCluster): definition = _DEFINITION async def UserPrompt(self, request): - input_result = input("") - for value in request.arguments.get("values", []): + expected_value = None + for value in request.arguments.get("values", []): if value.get('name') and 'expectedValue' in value['name']: - request.responses = [{"values": [{"name": "expectedValue", "value": value['value']}]}] - return {"value": {"expectedValue": input_result}} - return {} + expected_value = value['value'] + request.responses = [{"values": [{"name": "expectedValue", "value": expected_value}]}] + + if expected_value is not None: + input_result = input("") + return {"value": {"expectedValue": input_result}} + + return {} async def Log(self, request): pass