Skip to content

Commit

Permalink
Conformance: hack for missing temp control attributes (#30337)
Browse files Browse the repository at this point in the history
* Conformance: hack for missing temp control attributes

* Restyled by isort

---------

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
cecille and restyled-commits authored Nov 14, 2023
1 parent e895ebe commit 90a470f
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/python_testing/spec_parsing_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@
from enum import Enum, auto
from typing import Callable

import chip.clusters as Clusters
from chip.tlv import uint
from conformance_support import (DEPRECATE_CONFORM, DISALLOW_CONFORM, MANDATORY_CONFORM, OPTIONAL_CONFORM, OTHERWISE_CONFORM,
PROVISIONAL_CONFORM, ConformanceDecision, ConformanceException, ConformanceParseParameters,
or_operation, parse_callable_from_xml)
feature, or_operation, parse_callable_from_xml)
from matter_testing_support import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, EventPathLocation,
FeaturePathLocation, ProblemNotice, ProblemSeverity)

Expand Down Expand Up @@ -346,4 +347,17 @@ def build_xml_clusters() -> tuple[list[XmlCluster], list[ProblemNotice]]:
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
temp_control_id = Clusters.TemperatureControl.id
if temp_control_id in clusters and not clusters[temp_control_id].attributes:
clusters[temp_control_id].attributes = {
0x00: XmlAttribute(name='TemperatureSetpoint', datatype='temperature', conformance=feature(0x01, 'TN')),
0x01: XmlAttribute(name='MinTemperature', datatype='temperature', conformance=feature(0x01, 'TN')),
0x02: XmlAttribute(name='MaxTemperature', datatype='temperature', conformance=feature(0x01, 'TN')),
0x03: XmlAttribute(name='Step', datatype='temperature', conformance=feature(0x04, 'STEP')),
0x04: XmlAttribute(name='SelectedTemperatureLevel', datatype='uint8', conformance=feature(0x02, 'TL')),
0x05: XmlAttribute(name='SupportedTemperatureLevels', datatype='list', conformance=feature(0x02, 'TL')),
}

return clusters, problems

0 comments on commit 90a470f

Please sign in to comment.