Skip to content

Commit

Permalink
[matter_yamltests] Add SpecDefinitions.get_cluster_names to get all t…
Browse files Browse the repository at this point in the history
…he cluster names (#27252)
  • Loading branch information
vivien-apple authored and pull[bot] committed Oct 20, 2023
1 parent 1b2b211 commit 1783005
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/py_matter_yamltests/matter_yamltests/definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ def __init__(self, sources: List[ParseSource]):
self.__responses_by_id[code][struct.code] = struct
self.__responses_by_name[name][struct.name] = struct.code

def get_cluster_names(self) -> List[str]:
return [name for name, _ in self.__clusters_by_name.items()]

def get_cluster_name(self, cluster_id: int) -> str:
cluster = self.__clusters_by_id.get(cluster_id)
return cluster.name if cluster else None
Expand Down

0 comments on commit 1783005

Please sign in to comment.