Skip to content

Commit 9f5bb58

Browse files
TC-IDM-10.2: checks for non-spec clusters (project-chip#33695)
* TC-IDM-10.2: checks for non-spec clusters There are a number of clusters that appear in the spec adoc but are ifdef'd. These were not caught by the original provisional cluster checks. The following do not appear in the codegen and will therefore be caught in the IDM-10.1 test if they appear in cert (check that all clusters in the standard range have known IDs). These are therefore not included in the specific check. 0x0094 Water Heater Management 0x0095 Energy Price 0x009A Energy Calendar 0x009E Water Heater Mode 0x0450 Network Identity Management The following DOES appear in the 1.3-SVE codegen and are therefore checked explicitly: 0x0096 Demand Response and Load Control The following appears in the master codegen, but is not included in the 1.3-sve branch and will therefore fail the 10.1 test: 0x0451 WiFi Network Management There are also some completely non-spec clusters that appear in the codegen, but not in the spec at all. They appear to be zigbee only clusters. These are added to the new checks: 0x0007 On/off Switch Configuration 0x000F Binary Input (Basic) 0x0103 Barrier Control 0x0B04 Electrical Measurement In all cases, inclusion of these clusters on a device at cert SHOULD cause a failure in the PICS checker test as there is no way to specify these clusters in the PICS, but a definite check here is also beneficial. * Restyled by autopep8 * Restyled by isort * missed removing wifi in the test itself --------- Co-authored-by: Restyled.io <commits@restyled.io>
1 parent 99dda3b commit 9f5bb58

File tree

2 files changed

+30
-21
lines changed

2 files changed

+30
-21
lines changed

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

+19-18
Original file line numberDiff line numberDiff line change
@@ -27,31 +27,32 @@
2727
ApplicationBasic, ApplicationLauncher, AudioOutput, BallastConfiguration, BarrierControl, BasicInformation,
2828
BinaryInputBasic, Binding, BooleanState, BooleanStateConfiguration, BridgedDeviceBasicInformation,
2929
CarbonDioxideConcentrationMeasurement, CarbonMonoxideConcentrationMeasurement, Channel, ColorControl,
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,
36-
LevelControl, LocalizationConfiguration, LowPower, MediaInput, MediaPlayback, MicrowaveOvenControl,
37-
MicrowaveOvenMode, ModeSelect, NetworkCommissioning, NitrogenDioxideConcentrationMeasurement,
38-
OccupancySensing, OnOff, OnOffSwitchConfiguration, OperationalCredentials, OperationalState,
39-
OtaSoftwareUpdateProvider, OtaSoftwareUpdateRequestor, OvenCavityOperationalState, OvenMode,
40-
OzoneConcentrationMeasurement, Pm1ConcentrationMeasurement, Pm10ConcentrationMeasurement,
41-
Pm25ConcentrationMeasurement, PowerSource, PowerSourceConfiguration, PowerTopology, PressureMeasurement,
42-
ProxyConfiguration, ProxyDiscovery, ProxyValid, PulseWidthModulation, PumpConfigurationAndControl,
43-
RadonConcentrationMeasurement, RefrigeratorAlarm, RefrigeratorAndTemperatureControlledCabinetMode,
44-
RelativeHumidityMeasurement, RvcCleanMode, RvcOperationalState, RvcRunMode, ScenesManagement, SmokeCoAlarm,
45-
SoftwareDiagnostics, Switch, TargetNavigator, TemperatureControl, TemperatureMeasurement, Thermostat,
46-
ThermostatUserInterfaceConfiguration, ThreadNetworkDiagnostics, TimeFormatLocalization, TimeSynchronization,
30+
ContentControl, ContentLauncher, DemandResponseLoadControl, Descriptor, DeviceEnergyManagement,
31+
DeviceEnergyManagementMode, DiagnosticLogs, DishwasherAlarm, DishwasherMode, DoorLock,
32+
ElectricalEnergyMeasurement, ElectricalMeasurement, ElectricalPowerMeasurement, EnergyEvse, EnergyEvseMode,
33+
EnergyPreference, EthernetNetworkDiagnostics, FanControl, FaultInjection, FixedLabel, FlowMeasurement,
34+
FormaldehydeConcentrationMeasurement, GeneralCommissioning, GeneralDiagnostics, GroupKeyManagement, Groups,
35+
HepaFilterMonitoring, IcdManagement, Identify, IlluminanceMeasurement, KeypadInput, LaundryDryerControls,
36+
LaundryWasherControls, LaundryWasherMode, LevelControl, LocalizationConfiguration, LowPower, MediaInput,
37+
MediaPlayback, MicrowaveOvenControl, MicrowaveOvenMode, ModeSelect, NetworkCommissioning,
38+
NitrogenDioxideConcentrationMeasurement, OccupancySensing, OnOff, OnOffSwitchConfiguration,
39+
OperationalCredentials, OperationalState, OtaSoftwareUpdateProvider, OtaSoftwareUpdateRequestor,
40+
OvenCavityOperationalState, OvenMode, OzoneConcentrationMeasurement, Pm1ConcentrationMeasurement,
41+
Pm10ConcentrationMeasurement, Pm25ConcentrationMeasurement, PowerSource, PowerSourceConfiguration,
42+
PowerTopology, PressureMeasurement, ProxyConfiguration, ProxyDiscovery, ProxyValid, PulseWidthModulation,
43+
PumpConfigurationAndControl, RadonConcentrationMeasurement, RefrigeratorAlarm,
44+
RefrigeratorAndTemperatureControlledCabinetMode, RelativeHumidityMeasurement, RvcCleanMode,
45+
RvcOperationalState, RvcRunMode, ScenesManagement, SmokeCoAlarm, SoftwareDiagnostics, Switch, TargetNavigator,
46+
TemperatureControl, TemperatureMeasurement, Thermostat, ThermostatUserInterfaceConfiguration,
47+
ThreadNetworkDiagnostics, TimeFormatLocalization, TimeSynchronization,
4748
TotalVolatileOrganicCompoundsConcentrationMeasurement, UnitLocalization, UnitTesting, UserLabel,
4849
ValveConfigurationAndControl, WakeOnLan, WiFiNetworkDiagnostics, WindowCovering)
4950

5051
__all__ = [Attribute, CHIPClusters, Command, AccessControl, AccountLogin, Actions, ActivatedCarbonFilterMonitoring, AdministratorCommissioning, AirQuality,
5152
ApplicationBasic, ApplicationLauncher, AudioOutput, BallastConfiguration, BarrierControl, BasicInformation,
5253
BinaryInputBasic, Binding, BooleanState, BooleanStateConfiguration, BridgedDeviceBasicInformation, CarbonDioxideConcentrationMeasurement,
5354
CarbonMonoxideConcentrationMeasurement, Channel,
54-
ColorControl, ContentControl, ContentLauncher, Descriptor, DeviceEnergyManagementMode, DeviceEnergyManagement, DeviceEnergyManagementMode, DiagnosticLogs, DishwasherAlarm, DishwasherMode,
55+
ColorControl, ContentControl, ContentLauncher, DemandResponseLoadControl, Descriptor, DeviceEnergyManagementMode, DeviceEnergyManagement, DeviceEnergyManagementMode, DiagnosticLogs, DishwasherAlarm, DishwasherMode,
5556
DoorLock, ElectricalEnergyMeasurement, ElectricalMeasurement, ElectricalPowerMeasurement, EnergyEvse, EnergyEvseMode, EnergyPreference,
5657
EthernetNetworkDiagnostics, FanControl, FaultInjection, FixedLabel, FlowMeasurement,
5758
FormaldehydeConcentrationMeasurement, GeneralCommissioning, GeneralDiagnostics, GroupKeyManagement, Groups,

src/python_testing/TC_DeviceConformance.py

+11-3
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,20 @@ def record_warning(location, problem):
8080
provisional_cluster_ids = [Clusters.ContentControl.id, Clusters.ScenesManagement.id, Clusters.BallastConfiguration.id,
8181
Clusters.EnergyPreference.id, Clusters.DeviceEnergyManagement.id, Clusters.DeviceEnergyManagementMode.id, Clusters.PulseWidthModulation.id,
8282
Clusters.ProxyConfiguration.id, Clusters.ProxyDiscovery.id, Clusters.ProxyValid.id]
83+
# TODO: Remove this once the latest 1.3 lands with the clusters removed from the DM XML and change the warning below about missing DM XMLs into a proper error
84+
# These are clusters that weren't part of the 1.3 spec that landed in the SDK before the branch cut
85+
provisional_cluster_ids.extend([Clusters.DemandResponseLoadControl.id])
86+
# These clusters are zigbee only. I don't even know why they're part of the codegen, but we should get rid of them.
87+
provisional_cluster_ids.extend([Clusters.BarrierControl.id, Clusters.OnOffSwitchConfiguration.id,
88+
Clusters.BinaryInputBasic.id, Clusters.ElectricalMeasurement.id])
8389
for endpoint_id, endpoint in self.endpoints_tlv.items():
8490
for cluster_id, cluster in endpoint.items():
8591
cluster_location = ClusterPathLocation(endpoint_id=endpoint_id, cluster_id=cluster_id)
92+
93+
if not allow_provisional and cluster_id in provisional_cluster_ids:
94+
record_error(location=cluster_location, problem='Provisional cluster found on device')
95+
continue
96+
8697
if cluster_id not in self.xml_clusters.keys():
8798
if (cluster_id & 0xFFFF_0000) != 0:
8899
# manufacturer cluster
@@ -92,9 +103,6 @@ def record_warning(location, problem):
92103
problem='Standard cluster found on device, but is not present in spec data')
93104
continue
94105

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-
98106
feature_map = cluster[GlobalAttributeIds.FEATURE_MAP_ID]
99107
attribute_list = cluster[GlobalAttributeIds.ATTRIBUTE_LIST_ID]
100108
all_command_list = cluster[GlobalAttributeIds.ACCEPTED_COMMAND_LIST_ID] + \

0 commit comments

Comments
 (0)