|
26 | 26 | from typing import Callable, Optional
|
27 | 27 |
|
28 | 28 | import chip.clusters as Clusters
|
| 29 | +import conformance_support |
| 30 | + |
29 | 31 | from chip.tlv import uint
|
30 | 32 | from conformance_support import (OPTIONAL_CONFORM, TOP_LEVEL_CONFORMANCE_TAGS, ConformanceDecision, ConformanceException,
|
31 | 33 | ConformanceParseParameters, feature, is_disallowed, mandatory, optional, or_operation,
|
@@ -611,6 +613,25 @@ def remove_problem(location: typing.Union[CommandPathLocation, FeaturePathLocati
|
611 | 613 | 0x05: XmlAttribute(name='SupportedTemperatureLevels', datatype='list', conformance=feature(0x02, 'TL'), read_access=view, write_access=none, write_optional=False),
|
612 | 614 | }
|
613 | 615 |
|
| 616 | + # TODO: Need automated parsing for atomic attributes. |
| 617 | + atomic_request_cmd_id = 0xFE |
| 618 | + atomic_response_cmd_id = 0xFD |
| 619 | + atomic_request_name = "Atomic Request" |
| 620 | + atomic_response_name = "Atomic Response" |
| 621 | + presets_name = "Presets" |
| 622 | + schedules_name = "Schedules" |
| 623 | + if clusters[Clusters.Thermostat.id].revision >= 8: |
| 624 | + presents_id = clusters[Clusters.Thermostat.id].attribute_map[presets_name] |
| 625 | + schedules_id = clusters[Clusters.Thermostat.id].attribute_map[schedules_name] |
| 626 | + conformance = or_operation([conformance_support.attribute(presents_id, presets_name), |
| 627 | + conformance_support.attribute(schedules_id, schedules_name)]) |
| 628 | + clusters[Clusters.Thermostat.id].accepted_commands[atomic_request_cmd_id] = XmlCommand( |
| 629 | + id=atomic_request_cmd_id, name=atomic_request_name, conformance=conformance) |
| 630 | + clusters[Clusters.Thermostat.id].generated_commands[atomic_response_cmd_id] = XmlCommand( |
| 631 | + id=atomic_response_cmd_id, name=atomic_response_name, conformance=conformance) |
| 632 | + clusters[Clusters.Thermostat.id].command_map[atomic_request_name] = atomic_request_cmd_id |
| 633 | + clusters[Clusters.Thermostat.id].command_map[atomic_response_name] = atomic_response_cmd_id |
| 634 | + |
614 | 635 | check_clusters_for_unknown_commands(clusters, problems)
|
615 | 636 |
|
616 | 637 | return clusters, problems
|
|
0 commit comments