Skip to content

Commit

Permalink
[matter_yamltests] USe the type hint from the config section for node…
Browse files Browse the repository at this point in the history
…_id (#27008)
  • Loading branch information
vivien-apple authored Jun 2, 2023
1 parent da518d8 commit 43cfe21
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/py_matter_yamltests/matter_yamltests/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down

0 comments on commit 43cfe21

Please sign in to comment.