Skip to content

Commit

Permalink
Split ha.xml into individual dedicated cluster and types files (#24748)
Browse files Browse the repository at this point in the history
* Split ha.xml into individual dedicated cluster and types files

* Update generated content
  • Loading branch information
vivien-apple authored Feb 1, 2023
1 parent 34332ce commit 8dc9323
Show file tree
Hide file tree
Showing 16 changed files with 409 additions and 247 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ jobs:
src/app/zap-templates/zcl/data-model/chip/application-basic-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/audio-output-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/ballast-configuration-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/basic-information-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/binding-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/boolean-state-cluster.xml \
Expand All @@ -131,6 +132,7 @@ jobs:
src/app/zap-templates/zcl/data-model/chip/diagnostic-logs-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/ethernet-network-diagnostics-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/fan-control-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/fault-injection-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/fixed-label-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/flow-measurement-cluster.xml \
Expand All @@ -149,6 +151,7 @@ jobs:
src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/network-commissioning-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/occupancy-sensing-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/onoff-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/pressure-measurement-cluster.xml \
Expand All @@ -166,6 +169,7 @@ jobs:
src/app/zap-templates/zcl/data-model/chip/target-navigator-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/temperature-measurement-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/test-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/thermostat-user-interface-configuration-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/thermostat-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/thread-network-diagnostics-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml \
Expand All @@ -177,10 +181,10 @@ jobs:
src/app/zap-templates/zcl/data-model/chip/window-covering.xml \
src/app/zap-templates/zcl/data-model/chip/matter-devices.xml \
src/app/zap-templates/zcl/data-model/draft/barrier-control-cluster.xml \
src/app/zap-templates/zcl/data-model/draft/electrical-measurement-cluster.xml \
src/app/zap-templates/zcl/data-model/draft/input-output-value-clusters.xml \
src/app/zap-templates/zcl/data-model/draft/onoff-switch-configuration-cluster.xml \
src/app/zap-templates/zcl/data-model/silabs/ha-devices.xml \
src/app/zap-templates/zcl/data-model/silabs/ha.xml \
src/app/zap-templates/zcl/data-model/silabs/lo-devices.xml \
src/app/zap-templates/zcl/data-model/silabs/types-silabs.xml \
src/app/zap-templates/zcl/data-model/silabs/zll-devices.xml \
Expand Down
5 changes: 5 additions & 0 deletions scripts/rules.matterlint
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/administrator-commissioning-c
load "../src/app/zap-templates/zcl/data-model/chip/application-basic-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/audio-output-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/ballast-configuration-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/basic-information-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/binding-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/boolean-state-cluster.xml";
Expand All @@ -23,6 +24,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/descriptor-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/diagnostic-logs-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/ethernet-network-diagnostics-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/fan-control-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/fixed-label-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/flow-measurement-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/general-commissioning-cluster.xml";
Expand All @@ -41,6 +43,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/network-commissioning-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/occupancy-sensing-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/onoff-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/power-source-cluster.xml";
Expand All @@ -58,6 +61,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/switch-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/target-navigator-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/temperature-measurement-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/test-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/thermostat-user-interface-configuration-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/thermostat-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/thread-network-diagnostics-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml";
Expand All @@ -68,6 +72,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/wake-on-lan-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/wifi-network-diagnostics-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/window-covering.xml";
load "../src/app/zap-templates/zcl/data-model/draft/barrier-control-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/draft/electrical-measurement-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/draft/input-output-value-clusters.xml";
load "../src/app/zap-templates/zcl/data-model/draft/onoff-switch-configuration-cluster.xml";

Expand Down
3 changes: 0 additions & 3 deletions scripts/tests/chiptest/yamltest_with_chip_repl_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,6 @@ def _StackShutDown():
# Creating Cluster definition.
clusters_definitions = SpecDefinitionsFromPaths([
_CLUSTER_XML_DIRECTORY_PATH + '/chip/*.xml',

# Some still-silabs clusters
_CLUSTER_XML_DIRECTORY_PATH + '/silabs/ha.xml', # For fan control
])

# Parsing YAML test and setting up chip-repl yamltests runner.
Expand Down
6 changes: 5 additions & 1 deletion src/app/zap-templates/zcl/data-model/all.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<xi:include href="chip/application-basic-cluster.xml" />
<xi:include href="chip/application-launcher-cluster.xml" />
<xi:include href="chip/audio-output-cluster.xml" />
<xi:include href="chip/ballast-configuration-cluster.xml" />
<xi:include href="chip/basic-information-cluster.xml" />
<xi:include href="chip/binding-cluster.xml" />
<xi:include href="chip/boolean-state-cluster.xml" />
Expand All @@ -21,6 +22,7 @@
<xi:include href="chip/diagnostic-logs-cluster.xml" />
<xi:include href="chip/door-lock-cluster.xml" />
<xi:include href="chip/ethernet-network-diagnostics-cluster.xml" />
<xi:include href="chip/fan-control-cluster.xml" />
<xi:include href="chip/fault-injection-cluster.xml" />
<xi:include href="chip/fixed-label-cluster.xml" />
<xi:include href="chip/flow-measurement-cluster.xml" />
Expand All @@ -39,6 +41,7 @@
<xi:include href="chip/media-playback-cluster.xml" />
<xi:include href="chip/mode-select-cluster.xml" />
<xi:include href="chip/network-commissioning-cluster.xml" />
<xi:include href="chip/occupancy-sensing-cluster.xml" />
<xi:include href="chip/onoff-cluster.xml" />
<xi:include href="chip/operational-credentials-cluster.xml" />
<xi:include href="chip/pressure-measurement-cluster.xml" />
Expand All @@ -56,6 +59,7 @@
<xi:include href="chip/target-navigator-cluster.xml" />
<xi:include href="chip/temperature-measurement-cluster.xml" />
<xi:include href="chip/test-cluster.xml" />
<xi:include href="chip/thermostat-user-interface-configuration-cluster.xml" />
<xi:include href="chip/thermostat-cluster.xml" />
<xi:include href="chip/thread-network-diagnostics-cluster.xml" />
<xi:include href="chip/time-format-localization-cluster.xml" />
Expand All @@ -68,10 +72,10 @@
<xi:include href="chip/window-covering.xml" />
<xi:include href="chip/matter-devices.xml" />
<xi:include href="draft/barrier-control.xml" />
<xi:include href="draft/electrical-measurement-cluster.xml" />
<xi:include href="draft/input-output-value-clusters.xml" />
<xi:include href="draft/onoff-switch-configuration-cluster.xml" />
<xi:include href="silabs/ha-devices.xml" />
<xi:include href="silabs/ha.xml" />
<xi:include href="silabs/lo-devices.xml" />
<xi:include href="silabs/types-silabs.xml" />
<xi:include href="silabs/zll-devices.xml" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0"?>
<!--
Copyright (c) 2023 Project CHIP Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<configurator>
<domain name="Lighting"/>

<cluster>
<name>Ballast Configuration</name>
<domain>Lighting</domain>
<description>Attributes and commands for configuring a lighting ballast.</description>
<code>0x0301</code>
<define>BALLAST_CONFIGURATION_CLUSTER</define>

<client tick="false" init="false">true</client>
<server tick="false" init="false">true</server>

<globalAttribute side="either" code="0xFFFD" value="4"/>

<!-- Ballast Configuration Attribute Set -->
<attribute side="server" code="0x0000" define="PHYSICAL_MIN_LEVEL" type="INT8U" min="0x01" max="0xFE" writable="false" default="0x01" optional="false">PhysicalMinLevel</attribute>
<attribute side="server" code="0x0001" define="PHYSICAL_MAX_LEVEL" type="INT8U" min="0x01" max="0xFE" writable="false" default="0xFE" optional="false">PhysicalMaxLevel</attribute>
<attribute side="server" code="0x0002" define="BALLAST_STATUS" type="BITMAP8" min="0x00" max="0x03" writable="false" default="0x00" optional="true">BallastStatus</attribute>
<!-- Ballast Settings Attribute Set -->
<attribute side="server" code="0x0010" define="MIN_LEVEL" type="INT8U" min="0x01" max="0xFE" writable="true" default="0x01" optional="false">MinLevel</attribute>
<attribute side="server" code="0x0011" define="MAX_LEVEL" type="INT8U" min="0x01" max="0xFE" writable="true" default="0xFE" optional="false">MaxLevel</attribute>
<!-- PowerOnLevel and PowerOnFadeTime are deprecated -->
<attribute side="server" code="0x0014" define="INTRINSIC_BALLAST_FACTOR" type="INT8U" writable="true" isNullable="true" optional="true">IntrinsicBallastFactor</attribute>
<attribute side="server" code="0x0015" define="BALLAST_FACTOR_ADJUSTMENT" type="INT8U" min="0x64" writable="true" default="0xFF" isNullable="true" optional="true">BallastFactorAdjustment</attribute>
<!-- Lamp Information Attribute Set -->
<attribute side="server" code="0x0020" define="LAMP_QUANTITY" type="INT8U" writable="false" optional="false">LampQuantity</attribute>
<!-- Lamp Settings Attribute Set -->
<attribute side="server" code="0x0030" define="LAMP_TYPE" type="CHAR_STRING" length="16" writable="true" optional="true">LampType</attribute>
<attribute side="server" code="0x0031" define="LAMP_MANUFACTURER" type="CHAR_STRING" length="16" writable="true" optional="true">LampManufacturer</attribute>
<attribute side="server" code="0x0032" define="LAMP_RATED_HOURS" type="INT24U" writable="true" default="0xFFFFFF" isNullable="true" optional="true">LampRatedHours</attribute>
<attribute side="server" code="0x0033" define="LAMP_BURN_HOURS" type="INT24U" writable="true" default="0x000000" isNullable="true" optional="true">LampBurnHours</attribute>
<attribute side="server" code="0x0034" define="LAMP_ALARM_MODE" type="BITMAP8" min="0x00" max="0x01" writable="true" default="0x00" optional="true">LampAlarmMode</attribute>
<attribute side="server" code="0x0035" define="LAMP_BURN_HOURS_TRIP_POINT" type="INT24U" writable="true" default="0xFFFFFF" isNullable="true" optional="true">LampBurnHoursTripPoint</attribute>
</cluster>
</configurator>
90 changes: 90 additions & 0 deletions src/app/zap-templates/zcl/data-model/chip/fan-control-cluster.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<?xml version="1.0"?>
<!--
Copyright (c) 2023 Project CHIP Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<configurator>
<domain name="HVAC"/>

<bitmap name="FanControlFeature" type="BITMAP32">
<cluster code="0x0202" />
<field name="Multi-Speed" mask="0x01" />
<field name="Auto" mask="0x02" />
<field name="Rocking" mask="0x04" />
<field name="Wind" mask="0x08" />
</bitmap>

<enum name="FanModeType" type="ENUM8">
<cluster code="0x0202"/>
<item name="Off" value="0x00"/>
<item name="Low" value="0x01"/>
<item name="Medium" value="0x02"/>
<item name="High" value="0x03"/>
<item name="On" value="0x04"/>
<item name="Auto" value="0x05"/>
<item name="Smart" value="0x06"/>
</enum>

<enum name="FanModeSequenceType" type="ENUM8">
<cluster code="0x0202"/>
<item name="Off/Low/Med/High" value="0x00"/>
<item name="Off/Low/High" value="0x01"/>
<item name="Off/Low/Med/High/Auto" value="0x02"/>
<item name="Off/Low/High/Auto" value="0x03"/>
<item name="Off/On/Auto" value="0x04"/>
<item name="Off/On" value="0x05"/>
</enum>

<bitmap name="RockSupportMask" type="BITMAP8">
<cluster code="0x0202" />
<field name="RockLeftRight" mask="0x01" />
<field name="RockUpDown" mask="0x02" />
<field name="RockRound" mask="0x04" />
</bitmap>

<bitmap name="WindSupportMask" type="BITMAP8">
<cluster code="0x0202" />
<field name="Sleep Wind" mask="0x01" />
<field name="Natural Wind" mask="0x02" />
</bitmap>

<bitmap name="WindSettingMask" type="BITMAP8">
<cluster code="0x0202" />
<field name="Sleep Wind" mask="0x01" />
<field name="Natural Wind" mask="0x02" />
</bitmap>

<cluster>
<name>Fan Control</name>
<domain>HVAC</domain>
<description>An interface for controlling a fan in a heating/cooling system.</description>
<code>0x0202</code>
<define>FAN_CONTROL_CLUSTER</define>

<client tick="false" init="false">true</client>
<server tick="false" init="false">true</server>

<attribute side="server" code="0x0000" define="FAN_MODE" type="FanModeType" min="0" max="6" writable="true" default="0" optional="false">FanMode</attribute>
<attribute side="server" code="0x0001" define="FAN_MODE_SEQUENCE" type="FanModeSequenceType" min="0" max="5" writable="true" default="2" optional="false">FanModeSequence</attribute>
<attribute side="server" code="0x0002" define="PERCENT_SETTING" type="INT8U" min="0" max="100" writable="true" default="0" isNullable="true" optional="false">PercentSetting</attribute>
<attribute side="server" code="0x0003" define="PERCENT_CURRENT" type="INT8U" min="0" max="100" writable="false" default="0" optional="false">PercentCurrent</attribute>
<attribute side="server" code="0x0004" define="SPEED_MAX" type="INT8U" min="1" max="100" writable="false" default="1" optional="true">SpeedMax</attribute>
<attribute side="server" code="0x0005" define="SPEED_SETTING" type="INT8U" min="0" max="100" writable="true" default="0" isNullable="true" optional="true">SpeedSetting</attribute>
<attribute side="server" code="0x0006" define="SPEED_CURRENT" type="INT8U" min="0" max="100" writable="false" default="0" optional="true">SpeedCurrent</attribute>
<attribute side="server" code="0x0007" define="ROCK_SUPPORT" type="BITMAP8" writable="false" default="0x00" optional="true">RockSupport</attribute>
<attribute side="server" code="0x0008" define="ROCK_SETTING" type="BITMAP8" writable="true" default="0x00" optional="true">RockSetting</attribute>
<attribute side="server" code="0x0009" define="WIND_SUPPORT" type="BITMAP8" writable="false" default="0x00" optional="true">WindSupport</attribute>
<attribute side="server" code="0x000A" define="WIND_SETTING" type="BITMAP8" writable="true" default="0x00" optional="true">WindSetting</attribute>
</cluster>
</configurator>
Loading

0 comments on commit 8dc9323

Please sign in to comment.