Skip to content

Commit

Permalink
update_cluster_revisions.py excludes updating no-unique-id example's …
Browse files Browse the repository at this point in the history
…BINFO cluster (#35510)

---------

Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
  • Loading branch information
2 people authored and pull[bot] committed Oct 2, 2024
1 parent 198e822 commit 41db000
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions scripts/tools/zap/update_cluster_revisions.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,15 @@
import sys
from pathlib import Path

BASIC_INFORMATION_CLUSTER_ID = int("0x0039", 16)
CHIP_ROOT_DIR = os.path.realpath(
os.path.join(os.path.dirname(__file__), '../../..'))
EXCLUDE_FROM_UPDATE_DICTIONARY = {
BASIC_INFORMATION_CLUSTER_ID: ["lighting-app-data-mode-no-unique-id"]
}


def getTargets():
def getTargets(cluster_id: int):
ROOTS_TO_SEARCH = [
'./examples',
'./src/controller/data_model',
Expand All @@ -40,6 +44,10 @@ def getTargets():
for filepath in Path(root).rglob('*.zap'):
targets.append(filepath)

if cluster_id in EXCLUDE_FROM_UPDATE_DICTIONARY:
for target_to_exclude in EXCLUDE_FROM_UPDATE_DICTIONARY[cluster_id]:
targets = [target for target in targets if target_to_exclude not in target.parts]

return targets


Expand Down Expand Up @@ -130,7 +138,7 @@ def main():

os.chdir(CHIP_ROOT_DIR)

targets = getTargets()
targets = getTargets(args.cluster_id)

if args.dry_run:
for target in targets:
Expand Down

0 comments on commit 41db000

Please sign in to comment.