Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 9fa2bcc

Browse files
committedSep 17, 2024
Updated PICS Generator to match 1.4 PICS
1 parent 7789409 commit 9fa2bcc

File tree

1 file changed

+36
-19
lines changed

1 file changed

+36
-19
lines changed
 

‎src/tools/PICS-generator/PICSGenerator.py

+36-19
Original file line numberDiff line numberDiff line change
@@ -42,47 +42,62 @@ def GenerateDevicePicsXmlFiles(clusterName, clusterPicsCode, featurePicsList, at
4242

4343
# Map clusters to common XML template if needed
4444
if "ICDManagement" == clusterName:
45-
clusterName = "ICD Management"
45+
picsFileName = "ICD Management"
4646

47-
elif "OTA Software Update Provider" in clusterName or "OTA Software Update Requestor" in clusterName:
48-
clusterName = "OTA Software Update"
47+
elif "OTA Software Update Provider" in clusterName or \
48+
"OTA Software Update Requestor" in clusterName:
49+
picsFileName = "OTA Software Update"
4950

5051
elif "On/Off" == clusterName:
51-
clusterName = clusterName.replace("/", "-")
52+
picsFileName = clusterName.replace("/", "-")
5253

5354
elif "GroupKeyManagement" == clusterName:
54-
clusterName = "Group Communication"
55-
56-
elif "Wake On LAN" == clusterName or "Low Power" == clusterName:
57-
clusterName = "Media Cluster"
55+
picsFileName = "Group Communication"
56+
57+
elif "Wake on LAN" == clusterName or \
58+
"Low Power" == clusterName or \
59+
"Keypad Input" == clusterName or \
60+
"Audio Output" == clusterName or \
61+
"Media Input" == clusterName or \
62+
"Target Navigator" == clusterName or \
63+
"Content Control" == clusterName or \
64+
"Channel" == clusterName or \
65+
"Media Playback" == clusterName or \
66+
"Account Login" == clusterName or \
67+
"Application Basic" == clusterName or \
68+
"Content Launcher" == clusterName or \
69+
"Content App Observer" == clusterName or \
70+
"Application Launcher" == clusterName:
71+
72+
picsFileName = "Media Cluster"
5873

5974
elif "Operational Credentials" == clusterName:
60-
clusterName = "Node Operational Credentials"
61-
62-
elif "Laundry Washer Controls" == clusterName:
63-
clusterName = "Washer Controls"
75+
picsFileName = "Node Operational Credentials"
6476

6577
# Workaround for naming colisions with current logic
6678
elif "Thermostat" == clusterName:
67-
clusterName = "Thermostat Cluster"
79+
picsFileName = "Thermostat Cluster"
6880

6981
elif "Boolean State" == clusterName:
70-
clusterName = "Boolean State Cluster"
82+
picsFileName = "Boolean State Cluster"
83+
84+
elif "AccessControl" in clusterName:
85+
picsFileName = "Access Control Cluster"
7186

72-
if "AccessControl" in clusterName:
73-
clusterName = "Access Control cluster"
87+
else:
88+
picsFileName = clusterName
7489

7590
# Determine if file has already been handled and use this file
7691
for outputFolderFileName in os.listdir(outputPathStr):
77-
if clusterName in outputFolderFileName:
92+
if picsFileName in outputFolderFileName:
7893
xmlPath = outputPathStr
7994
fileName = outputFolderFileName
8095
break
8196

8297
# If no file is found in output folder, determine if there is a match for the cluster name in input folder
8398
if fileName == "":
8499
for file in xmlFileList:
85-
if file.lower().startswith(clusterName.lower()):
100+
if file.lower().startswith(picsFileName.lower()):
86101
fileName = file
87102
break
88103
else:
@@ -421,9 +436,11 @@ def cleanDirectory(pathToClean):
421436
# Load PICS XML templates
422437
print("Capture list of PICS XML templates")
423438
xmlFileList = os.listdir(xmlTemplatePathStr)
439+
for PICSXmlFile in xmlFileList:
440+
print(f"{xmlTemplatePathStr}/{PICSXmlFile}")
424441

425442
# Setup output path
426-
print(outputPathStr)
443+
print(f"Output path: {outputPathStr}")
427444

428445
outputPath = pathlib.Path(outputPathStr)
429446
if not outputPath.exists():

0 commit comments

Comments
 (0)
Please sign in to comment.