Skip to content

Commit 01acab1

Browse files
Added the missed part of the code after hard reset from commit d0e3690
1 parent d0e3690 commit 01acab1

File tree

1 file changed

+19
-0
lines changed
  • src/python_testing/matter_testing_infrastructure/matter_testing_support

1 file changed

+19
-0
lines changed

src/python_testing/matter_testing_infrastructure/matter_testing_support/spec_parsing.py

+19
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,25 @@ def remove_problem(location: typing.Union[CommandPathLocation, FeaturePathLocati
630630
0x05: XmlAttribute(name='SupportedTemperatureLevels', datatype='list', conformance=feature(0x02, 'TL'), read_access=view, write_access=none, write_optional=False),
631631
}
632632

633+
# TODO: Need automated parsing for atomic attributes.
634+
atomic_request_cmd_id = 0xFE
635+
atomic_response_cmd_id = 0xFD
636+
atomic_request_name = "Atomic Request"
637+
atomic_response_name = "Atomic Response"
638+
presets_name = "Presets"
639+
schedules_name = "Schedules"
640+
if clusters[Clusters.Thermostat.id].revision >= 8:
641+
presents_id = clusters[Clusters.Thermostat.id].attribute_map[presets_name]
642+
schedules_id = clusters[Clusters.Thermostat.id].attribute_map[schedules_name]
643+
conformance = or_operation([conformance.attribute(presents_id, presets_name),
644+
conformance.attribute(schedules_id, schedules_name)])
645+
clusters[Clusters.Thermostat.id].accepted_commands[atomic_request_cmd_id] = XmlCommand(
646+
id=atomic_request_cmd_id, name=atomic_request_name, conformance=conformance)
647+
clusters[Clusters.Thermostat.id].generated_commands[atomic_response_cmd_id] = XmlCommand(
648+
id=atomic_response_cmd_id, name=atomic_response_name, conformance=conformance)
649+
clusters[Clusters.Thermostat.id].command_map[atomic_request_name] = atomic_request_cmd_id
650+
clusters[Clusters.Thermostat.id].command_map[atomic_response_name] = atomic_response_cmd_id
651+
633652
check_clusters_for_unknown_commands(clusters, problems)
634653

635654
return clusters, problems

0 commit comments

Comments
 (0)