Skip to content

Commit 99dda3b

Browse files
TC-IDM-10.2: Add test for provisional clusters (project-chip#33361)
* TC-IDM-10.2: Add test for provisional clusters * Restyled by autopep8 * Un-hard-code IDs * Add content control to the init file so we can use the ID * Add some more provisional clusters * Restyled by autopep8 * Restyled by isort * Add in a couple more provisional from main spec * it's nice to add ALL the changes before uploading --------- Co-authored-by: Restyled.io <commits@restyled.io>
1 parent ba510d4 commit 99dda3b

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

src/controller/python/chip/clusters/__init__.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@
2727
ApplicationBasic, ApplicationLauncher, AudioOutput, BallastConfiguration, BarrierControl, BasicInformation,
2828
BinaryInputBasic, Binding, BooleanState, BooleanStateConfiguration, BridgedDeviceBasicInformation,
2929
CarbonDioxideConcentrationMeasurement, CarbonMonoxideConcentrationMeasurement, Channel, ColorControl,
30-
ContentLauncher, Descriptor, DeviceEnergyManagement, DeviceEnergyManagementMode, DiagnosticLogs,
31-
DishwasherAlarm, DishwasherMode, DoorLock, ElectricalEnergyMeasurement, ElectricalMeasurement,
32-
ElectricalPowerMeasurement, EnergyEvse, EnergyEvseMode, EthernetNetworkDiagnostics, FanControl,
33-
FaultInjection, FixedLabel, FlowMeasurement, FormaldehydeConcentrationMeasurement, GeneralCommissioning,
34-
GeneralDiagnostics, GroupKeyManagement, Groups, HepaFilterMonitoring, IcdManagement, Identify,
35-
IlluminanceMeasurement, KeypadInput, LaundryDryerControls, LaundryWasherControls, LaundryWasherMode,
30+
ContentControl, ContentLauncher, Descriptor, DeviceEnergyManagement, DeviceEnergyManagementMode,
31+
DiagnosticLogs, DishwasherAlarm, DishwasherMode, DoorLock, ElectricalEnergyMeasurement, ElectricalMeasurement,
32+
ElectricalPowerMeasurement, EnergyEvse, EnergyEvseMode, EnergyPreference, EthernetNetworkDiagnostics,
33+
FanControl, FaultInjection, FixedLabel, FlowMeasurement, FormaldehydeConcentrationMeasurement,
34+
GeneralCommissioning, GeneralDiagnostics, GroupKeyManagement, Groups, HepaFilterMonitoring, IcdManagement,
35+
Identify, IlluminanceMeasurement, KeypadInput, LaundryDryerControls, LaundryWasherControls, LaundryWasherMode,
3636
LevelControl, LocalizationConfiguration, LowPower, MediaInput, MediaPlayback, MicrowaveOvenControl,
3737
MicrowaveOvenMode, ModeSelect, NetworkCommissioning, NitrogenDioxideConcentrationMeasurement,
3838
OccupancySensing, OnOff, OnOffSwitchConfiguration, OperationalCredentials, OperationalState,
@@ -51,8 +51,8 @@
5151
ApplicationBasic, ApplicationLauncher, AudioOutput, BallastConfiguration, BarrierControl, BasicInformation,
5252
BinaryInputBasic, Binding, BooleanState, BooleanStateConfiguration, BridgedDeviceBasicInformation, CarbonDioxideConcentrationMeasurement,
5353
CarbonMonoxideConcentrationMeasurement, Channel,
54-
ColorControl, ContentLauncher, Descriptor, DeviceEnergyManagementMode, DeviceEnergyManagement, DiagnosticLogs, DishwasherAlarm, DishwasherMode,
55-
DoorLock, ElectricalEnergyMeasurement, ElectricalMeasurement, ElectricalPowerMeasurement, EnergyEvse, EnergyEvseMode,
54+
ColorControl, ContentControl, ContentLauncher, Descriptor, DeviceEnergyManagementMode, DeviceEnergyManagement, DeviceEnergyManagementMode, DiagnosticLogs, DishwasherAlarm, DishwasherMode,
55+
DoorLock, ElectricalEnergyMeasurement, ElectricalMeasurement, ElectricalPowerMeasurement, EnergyEvse, EnergyEvseMode, EnergyPreference,
5656
EthernetNetworkDiagnostics, FanControl, FaultInjection, FixedLabel, FlowMeasurement,
5757
FormaldehydeConcentrationMeasurement, GeneralCommissioning, GeneralDiagnostics, GroupKeyManagement, Groups,
5858
HepaFilterMonitoring, IcdManagement, Identify, IlluminanceMeasurement, KeypadInput, LaundryDryerControls,

src/python_testing/TC_DeviceConformance.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,25 @@ def record_warning(location, problem):
7676

7777
success = True
7878
allow_provisional = self.user_params.get("allow_provisional", False)
79+
# TODO: automate this once https://github.com/csa-data-model/projects/issues/454 is done.
80+
provisional_cluster_ids = [Clusters.ContentControl.id, Clusters.ScenesManagement.id, Clusters.BallastConfiguration.id,
81+
Clusters.EnergyPreference.id, Clusters.DeviceEnergyManagement.id, Clusters.DeviceEnergyManagementMode.id, Clusters.PulseWidthModulation.id,
82+
Clusters.ProxyConfiguration.id, Clusters.ProxyDiscovery.id, Clusters.ProxyValid.id]
7983
for endpoint_id, endpoint in self.endpoints_tlv.items():
8084
for cluster_id, cluster in endpoint.items():
85+
cluster_location = ClusterPathLocation(endpoint_id=endpoint_id, cluster_id=cluster_id)
8186
if cluster_id not in self.xml_clusters.keys():
8287
if (cluster_id & 0xFFFF_0000) != 0:
8388
# manufacturer cluster
8489
continue
85-
location = ClusterPathLocation(endpoint_id=endpoint_id, cluster_id=cluster_id)
8690
# TODO: update this from a warning once we have all the data
87-
record_warning(location=location, problem='Standard cluster found on device, but is not present in spec data')
91+
record_warning(location=cluster_location,
92+
problem='Standard cluster found on device, but is not present in spec data')
8893
continue
8994

95+
if not allow_provisional and cluster_id in provisional_cluster_ids:
96+
record_error(location=cluster_location, problem='Provisional cluster found on device')
97+
9098
feature_map = cluster[GlobalAttributeIds.FEATURE_MAP_ID]
9199
attribute_list = cluster[GlobalAttributeIds.ATTRIBUTE_LIST_ID]
92100
all_command_list = cluster[GlobalAttributeIds.ACCEPTED_COMMAND_LIST_ID] + \

0 commit comments

Comments
 (0)