Skip to content

Commit

Permalink
Conformance checker: Add more aliased clusters (project-chip#30334)
Browse files Browse the repository at this point in the history
  • Loading branch information
cecille authored Nov 15, 2023
1 parent 56e35e7 commit 0be8542
Showing 1 changed file with 26 additions and 17 deletions.
43 changes: 26 additions & 17 deletions src/python_testing/spec_parsing_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,23 +329,32 @@ def build_xml_clusters() -> tuple[list[XmlCluster], list[ProblemNotice]]:
clusters[id] = new

# workaround for aliased clusters not appearing in the xml. Remove this once https://github.com/csa-data-model/projects/issues/373 is addressed
aliased_clusters = {0x040C: 'Carbon Monoxide Concentration Measurement',
0x040D: 'Carbon Dioxide Concentration Measurement',
0x0413: 'Nitrogen Dioxide Concentration Measurement',
0x0415: 'Ozone Concentration Measurement',
0x042A: 'PM2.5 Concentration Measurement',
0x042B: 'Formaldehyde Concentration Measurement',
0x042C: 'PM1 Concentration Measurement',
0x042D: 'PM10 Concentration Measurement',
0x042E: 'Total Volatile Organic Compounds Concentration Measurement',
0x042F: 'Radon Concentration Measurement'}
alias_base_name = 'Concentration Measurement Clusters'
for id, alias_name in aliased_clusters.items():
base = derived_clusters[alias_base_name]
new = deepcopy(base)
new.derived = alias_base_name
new.name = alias_name
clusters[id] = new
conc_clusters = {0x040C: 'Carbon Monoxide Concentration Measurement',
0x040D: 'Carbon Dioxide Concentration Measurement',
0x0413: 'Nitrogen Dioxide Concentration Measurement',
0x0415: 'Ozone Concentration Measurement',
0x042A: 'PM2.5 Concentration Measurement',
0x042B: 'Formaldehyde Concentration Measurement',
0x042C: 'PM1 Concentration Measurement',
0x042D: 'PM10 Concentration Measurement',
0x042E: 'Total Volatile Organic Compounds Concentration Measurement',
0x042F: 'Radon Concentration Measurement'}
conc_base_name = 'Concentration Measurement Clusters'
resource_clusters = {0x0071: 'HEPA Filter Monitoring',
0x0072: 'Activated Carbon Filter Monitoring'}
resource_base_name = 'Resource Monitoring Clusters'
water_clusters = {0x0405: 'Relative Humidity Measurement',
0x0407: 'Leaf Wetness Measurement',
0x0408: 'Soil Moisture Measurement'}
water_base_name = 'Water Content Measurement Clusters'
aliases = {conc_base_name: conc_clusters, resource_base_name: resource_clusters, water_base_name: water_clusters}
for alias_base_name, aliased_clusters in aliases.items():
for id, alias_name in aliased_clusters.items():
base = derived_clusters[alias_base_name]
new = deepcopy(base)
new.derived = alias_base_name
new.name = alias_name
clusters[id] = new

# Workaround for temp control cluster - this is parsed incorrectly in the DM XML and is missing all its attributes
# Remove this workaround when https://github.com/csa-data-model/projects/issues/330 is fixed
Expand Down

0 comments on commit 0be8542

Please sign in to comment.