Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conformance: hack for missing temp control attributes #30337

Merged
merged 2 commits into from
Nov 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading