From 373408346859b8ebb6c85b07f10b7e5d9aaa9c32 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Thu, 15 Jun 2023 09:42:00 +0200 Subject: [PATCH] [chip-tool] Translate all ById command properly even when the cluster is not Any (#27251) --- .../matter_chip_tool_adapter/encoder.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py b/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py index f060a50c7604a4..2b5463412e4f43 100644 --- a/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py +++ b/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py @@ -34,8 +34,7 @@ _ALIASES = { - 'AnyCommands': { - 'alias': 'any', + '*': { 'commands': { 'CommandById': { 'alias': 'command-by-id', @@ -98,6 +97,9 @@ }, } }, + 'AnyCommands': { + 'alias': 'any', + }, 'CommissionerCommands': { 'alias': 'pairing', 'commands': { @@ -313,7 +315,7 @@ def __get_argument_name(self, request, entry): else: argument_name = 'value' - return self.__get_alias(cluster_name, command_name, argument_name) or argument_name + return self.__get_alias('*', command_name, argument_name) or self.__get_alias(cluster_name, command_name, argument_name) or argument_name def __maybe_add(self, rv, value, name): if value is None: