From 6fdab6f37349bfcb4a2efa5e19f683f7f2e30687 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Fri, 2 Jun 2023 02:30:33 +0200 Subject: [PATCH] [matter_yamltests] USe the type hint from the config section for node_id (#27008) --- scripts/py_matter_yamltests/matter_yamltests/parser.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/py_matter_yamltests/matter_yamltests/parser.py b/scripts/py_matter_yamltests/matter_yamltests/parser.py index d039e80f96519d..6b0cd11999bca4 100644 --- a/scripts/py_matter_yamltests/matter_yamltests/parser.py +++ b/scripts/py_matter_yamltests/matter_yamltests/parser.py @@ -994,12 +994,15 @@ def __apply_config_override(self, config, config_override): if value is None or not key in config: continue + is_node_id = key == 'nodeId' or (isinstance( + config[key], dict) and config[key].get('type') == 'node_id') + if type(value) is str: if key == 'timeout' or key == 'endpoint': value = int(value) - elif key == 'nodeId' and value.startswith('0x'): + elif is_node_id and value.startswith('0x'): value = int(value, 16) - elif key == 'nodeId': + elif is_node_id: value = int(value) if isinstance(config[key], dict) and 'defaultValue' in config[key]: