From 15194616a06d8d7ce495720bc5a8509d63073c93 Mon Sep 17 00:00:00 2001 From: C Freeman Date: Tue, 14 Nov 2023 18:13:34 +0100 Subject: [PATCH] Conformance: hack for missing temp control attributes (#30337) * Conformance: hack for missing temp control attributes * Restyled by isort --------- Co-authored-by: Restyled.io --- src/python_testing/spec_parsing_support.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/python_testing/spec_parsing_support.py b/src/python_testing/spec_parsing_support.py index 9cf3cfa86a7307..2a133e97362c1f 100644 --- a/src/python_testing/spec_parsing_support.py +++ b/src/python_testing/spec_parsing_support.py @@ -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) @@ -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