diff --git a/examples/placeholder/py_matter_placeholder_adapter/matter_placeholder_adapter/adapter.py b/examples/placeholder/py_matter_placeholder_adapter/matter_placeholder_adapter/adapter.py index 8073282d83683a..da92f0976ef4a8 100644 --- a/examples/placeholder/py_matter_placeholder_adapter/matter_placeholder_adapter/adapter.py +++ b/examples/placeholder/py_matter_placeholder_adapter/matter_placeholder_adapter/adapter.py @@ -72,6 +72,8 @@ def decode(self, payload): clusterId = json_response[_CLUSTER_ID] decoded_response[_COMMAND] = self.__definitions.get_response_name( clusterId, value) + if not decoded_response[_COMMAND]: + decoded_response[_COMMAND] = self.__definitions.get_command_name(clusterId, value) elif key == _ATTRIBUTE_ID: clusterId = json_response[_CLUSTER_ID] decoded_response[_ATTRIBUTE] = self.__definitions.get_attribute_name( diff --git a/scripts/py_matter_yamltests/matter_yamltests/parser.py b/scripts/py_matter_yamltests/matter_yamltests/parser.py index b5743b852d9ba9..6cebea186895c0 100644 --- a/scripts/py_matter_yamltests/matter_yamltests/parser.py +++ b/scripts/py_matter_yamltests/matter_yamltests/parser.py @@ -189,6 +189,8 @@ def __init__(self, test: dict, config: dict, definitions: SpecDefinitions, pics_ self.group_id = _value_or_config(test, 'groupId', config) self.cluster = _value_or_config(test, 'cluster', config) self.command = _value_or_config(test, 'command', config) + if not self.command: + self.command = _value_or_config(test, 'wait', config) self.attribute = _value_or_none(test, 'attribute') self.event = _value_or_none(test, 'event') self.endpoint = _value_or_config(test, 'endpoint', config) @@ -786,8 +788,12 @@ def _response_cluster_wait_validation(self, received_responses, result): expected_wait_type ] + wait_for_str = received_response.get('wait_for') + if not wait_for_str: + wait_for_str = received_response.get('command') + received_values = [ - received_response.get('wait_for'), + wait_for_str, received_response.get('endpoint'), received_response.get('cluster'), received_wait_type diff --git a/scripts/py_matter_yamltests/matter_yamltests/yaml_loader.py b/scripts/py_matter_yamltests/matter_yamltests/yaml_loader.py index efc6adcea2b41a..5f1352ced6d40e 100644 --- a/scripts/py_matter_yamltests/matter_yamltests/yaml_loader.py +++ b/scripts/py_matter_yamltests/matter_yamltests/yaml_loader.py @@ -266,7 +266,9 @@ def __rule_response_variable_should_exist_in_config(self, config, content): def __rule_argument_value_is_only_when_writing_attributes(self, content): if 'arguments' in content: - command = content.get('command') + operation = content.get('command') + if not operation: + operation = content.get('wait') arguments = content.get('arguments') - if 'value' in arguments and command != 'writeAttribute': + if 'value' in arguments and operation != 'writeAttribute': raise TestStepArgumentsValueError(content)