Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate XML using Alchemy tool for closure cluster and device type #37371

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ jobs:
--log-level info \
src/app/zap-templates/zcl/data-model/chip/global-attributes.xml \
src/app/zap-templates/zcl/data-model/chip/chime-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/closure-control-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/closure-dimension-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/global-bitmaps.xml \
src/app/zap-templates/zcl/data-model/chip/global-enums.xml \
src/app/zap-templates/zcl/data-model/chip/global-structs.xml \
Expand Down
2 changes: 2 additions & 0 deletions scripts/rules.matterlint
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ load "../src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/chime-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/chip-ota.xml";
load "../src/app/zap-templates/zcl/data-model/chip/chip-types.xml";
load "../src/app/zap-templates/zcl/data-model/chip/closure-control-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/closure-dimension-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/clusters-extensions.xml";
load "../src/app/zap-templates/zcl/data-model/chip/color-control-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/commissioner-control-cluster.xml";
Expand Down
261 changes: 261 additions & 0 deletions src/app/zap-templates/zcl/data-model/chip/closure-control-cluster.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,261 @@
<?xml version="1.0"?>
<!--
Copyright (c) 2025 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.
-->
<!--
XML generated by Alchemy; DO NOT EDIT.
Source: src/app_clusters/ClosureControl.adoc
Parameters: in-progress
Git: 0.7-summer-2025-dirty
-->
<configurator xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../zcl.xsd">
<domain name="Closures"/>
<enum name="ClosureErrorEnum" type="enum8">
<cluster code="0x0104"/>
<item name="Blocked" value="0x00"/>
<item name="TemperatureLimited" value="0x01"/>
<item name="MaintenanceRequired" value="0x02"/>
<item name="InternalInterference" value="0x03"/>
</enum>

<enum name="LatchingEnum" type="enum8">
<cluster code="0x0104"/>
<cluster code="0x0106"/>
Comment on lines +34 to +35
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the spec.... you can't just randomly reference a data type from cluster X in cluster Y. I mean, you can write that, and Alchemy seems to "do something" with it as here, but it's broken, because data type names are not unique; so they are always scoped to the cluster they are defined in, except for global data types, which do have unique names.

Comment on lines +34 to +35
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this not apply to all the cluster IDs for Closure Dimension?

<item name="LatchedAndSecured" value="0x00"/>
<item name="LatchedButNotSecured" value="0x01"/>
<item name="NotLatched" value="0x02"/>
</enum>

<enum name="MainStateEnum" type="enum8">
<cluster code="0x0104"/>
<item name="Stopped" value="0x00"/>
<item name="Moving" value="0x01"/>
<item name="WaitingForMotion" value="0x02"/>
<item name="Error" value="0x03"/>
<item name="Calibrating" value="0x04"/>
<item name="Protected" value="0x05"/>
<item name="Disengaged" value="0x06"/>
<item name="SetupRequired" value="0x07"/>
<item name="PendingFallback" value="0x08"/>
</enum>

<enum name="PositioningEnum" type="enum8">
<cluster code="0x0104"/>
<item name="FullyClosed" value="0x00"/>
<item name="FullyOpened" value="0x01"/>
<item name="PartiallyOpened" value="0x02"/>
<item name="OpenedForPedestrian" value="0x03"/>
<item name="OpenedForVentilation" value="0x04"/>
<item name="OpenedAtSignature" value="0x05"/>
</enum>

<enum name="RestingProcedureEnum" type="enum8">
<cluster code="0x0104"/>
<item name="DoNothing" value="0x00"/>
<item name="ReturnToFullyOpened" value="0x01"/>
<item name="ReturnToFullyClosed" value="0x02"/>
</enum>

<enum name="TagLatchEnum" type="enum8">
<cluster code="0x0104"/>
<cluster code="0x0105"/>
<cluster code="0x0106"/>
<cluster code="0x0107"/>
<cluster code="0x0108"/>
<cluster code="0x0109"/>
<item name="Latch" value="0x00"/>
<item name="Unlatch" value="0x01"/>
</enum>

<enum name="TagPositionEnum" type="enum8">
<cluster code="0x0104"/>
<item name="CloseInFull" value="0x00"/>
<item name="OpenInFull" value="0x01"/>
<item name="Pedestrian" value="0x02"/>
<item name="Ventilation" value="0x03"/>
<item name="Signature" value="0x04"/>
<item name="SequenceNextStep" value="0x05"/>
<item name="PedestrianNextStep" value="0x06"/>
</enum>

<enum name="TriggerConditionEnum" type="enum8">
<cluster code="0x0104"/>
<item name="AfterDelay" value="0x00"/>
<item name="AfterApplicativeTrigger" value="0x01"/>
<item name="AfterDelayOrApplicativeTrigger" value="0x02"/>
</enum>

<enum name="TriggerPositionEnum" type="enum8">
<cluster code="0x0104"/>
<item name="AtFullyClosed" value="0x00"/>
<item name="AtFullyOpened" value="0x01"/>
<item name="InBetween" value="0x02"/>
<item name="AtVentilation" value="0x03"/>
<item name="AtPedestrian" value="0x04"/>
</enum>

<struct name="OverallStateStruct" apiMaturity="provisional">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the enums also be tagged with apiMaturity="provisional"?

<cluster code="0x0104"/>
<item fieldId="0" name="Positioning" type="PositioningEnum" optional="true" default="0x02" min="0x00" max="0x05"/>
<item fieldId="1" name="Latching" type="LatchingEnum" optional="true" default="0x02" min="0x00" max="0x02"/>
<item fieldId="2" name="Speed" type="ThreeLevelAutoEnum" optional="true" default="0x00" min="0x00" max="0x03"/>
<item fieldId="3" name="ExtraInfo" type="bitmap32" optional="true"/>
</struct>

<struct name="OverallTargetStruct" apiMaturity="provisional">
<cluster code="0x0104"/>
<item fieldId="0" name="TagPosition" type="TagPositionEnum" optional="true" min="0x00" max="0x06"/>
<item fieldId="1" name="TagLatch" type="TagLatchEnum" optional="true" min="0x00" max="0x01"/>
<item fieldId="2" name="Speed" type="ThreeLevelAutoEnum" optional="true" min="0x00" max="0x03"/>
</struct>

<cluster>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this have apiMaturity="provisional"?

<domain>Closures</domain>
<name>Closure Control</name>
<code>0x0104</code>
<define>CLOSURE_CONTROL_CLUSTER</define>
<description/>
<client init="false" tick="false">true</client>
<server init="false" tick="false">true</server>
<globalAttribute code="0xFFFD" side="either" value="1"/>
<attribute code="0x0000" side="server" define="COUNTDOWN_TIME" type="elapsed_s" isNullable="true" max="259200" optional="true">
<description>CountdownTime</description>
<optionalConform/>
Comment on lines +133 to +135
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this is an alchemy question, but why do we have both optional="true" and optionalConform here? @hasty

</attribute>
<attribute code="0x0001" side="server" define="MAIN_STATE" type="MainStateEnum" min="0x00" max="0x08">MainState</attribute>
<attribute code="0x0002" side="server" define="CURRENT_ERROR_LIST" type="array" entryType="ClosureErrorEnum">CurrentErrorList</attribute>
<attribute code="0x0003" side="server" define="OVERALL_STATE" type="OverallStateStruct" isNullable="true">OverallState</attribute>
<attribute code="0x0004" side="server" define="OVERALL_TARGET" type="OverallTargetStruct" isNullable="true">OverallTarget</attribute>
<attribute code="0x0005" side="server" define="RESTING_PROCEDURE" type="RestingProcedureEnum" min="0x00" max="0x02" optional="true">
<description>RestingProcedure</description>
<mandatoryConform>
<feature name="FB"/>
</mandatoryConform>
</attribute>
<attribute code="0x0006" side="server" define="TRIGGER_CONDITION" type="TriggerConditionEnum" min="0x00" max="0x02" optional="true">
<description>TriggerCondition</description>
<mandatoryConform>
<feature name="FB"/>
</mandatoryConform>
</attribute>
<attribute code="0x0007" side="server" define="TRIGGER_POSITION" type="TriggerPositionEnum" min="0x00" max="0x04" optional="true">
<description>TriggerPosition</description>
<mandatoryConform>
<feature name="FB"/>
</mandatoryConform>
</attribute>
<attribute code="0x0008" side="server" define="WAITING_DELAY" type="elapsed_s" max="86400" default="60" optional="true">
<description>WaitingDelay</description>
<mandatoryConform>
<feature name="FB"/>
</mandatoryConform>
</attribute>
<attribute code="0x0009" side="server" define="KICKOFF_TIMER" type="elapsed_s" max="86400" default="0" optional="true">
<description>KickoffTimer</description>
<mandatoryConform>
<feature name="FB"/>
</mandatoryConform>
</attribute>
<command code="0x00" source="client" name="Stop" optional="true">
<description>On receipt of this command, the device SHALL stop its operation if it is at a position where it is safe to do so and/or permitted.</description>
<mandatoryConform>
<notTerm>
<feature name="IS"/>
</notTerm>
</mandatoryConform>
</command>

<command code="0x01" source="client" name="MoveTo" optional="false">
<description>Upon receipt, this SHALL move the product in the most fitting state following the data as follows: </description>
<arg id="0" name="Tag" type="TagPositionEnum" optional="true" min="0x00" max="0x06"/>
<arg id="1" name="Latch" type="TagLatchEnum" optional="true" min="0x00" max="0x01"/>
<arg id="2" name="Speed" type="ThreeLevelAutoEnum" optional="true" min="0x00" max="0x03"/>
</command>

<command code="0x02" source="client" name="Calibrate" optional="true">
<description>Upon receipt, this SHALL initiate a calibration.</description>
<access op="invoke" privilege="manage"/>
<mandatoryConform>
<feature name="CL"/>
</mandatoryConform>
</command>

<command code="0x03" source="client" name="ConfigureFallback" optional="true">
<description>Upon receipt, this SHALL configure the Fallback feature behavior using the data as follows: </description>
<arg id="0" name="RestingProcedure" type="RestingProcedureEnum" optional="true" min="0x00" max="0x02"/>
<arg id="1" name="TriggerCondition" type="TriggerConditionEnum" optional="true" min="0x00" max="0x02"/>
<arg id="2" name="TriggerPosition" type="TriggerPositionEnum" optional="true" min="0x00" max="0x04"/>
<arg id="3" name="WaitingDelay" type="elapsed_s" optional="true" max="86400"/>
<mandatoryConform>
<feature name="FB"/>
</mandatoryConform>
</command>

<command code="0x04" source="client" name="CancelFallback" optional="true">
<description>Upon receipt, this SHALL cancel the current PendingFallback.</description>
<mandatoryConform>
<feature name="FB"/>
</mandatoryConform>
</command>

<features>
<feature bit="0" code="PS" name="Positioning" summary="Supports positioning with at least Fully Opened (0%) and Fully Closed (100%) discrete position">
<optionalConform choice="a" more="true" min="1"/>
</feature>
<feature bit="1" code="LT" name="MotionLatching" summary="Supports a latch (securing a position, a state ...)">
<optionalConform choice="a" more="true" min="1"/>
</feature>
<feature bit="2" code="IS" name="Instantaneous" summary="Supports the Instantaneous feature">
<optionalConform/>
</feature>
<feature bit="3" code="SP" name="Speed" summary="Supports speed motion throttling">
<optionalConform>
<andTerm>
<feature name="PS"/>
<notTerm>
<feature name="IS"/>
</notTerm>
</andTerm>
</optionalConform>
</feature>
<feature bit="4" code="VT" name="Ventilation" summary="Supports Ventilation discrete state">
<optionalConform>
<feature name="PS"/>
</optionalConform>
</feature>
<feature bit="5" code="PD" name="Pedestrian" summary="Supports Pedestrian discrete state">
<optionalConform>
<feature name="PS"/>
</optionalConform>
</feature>
<feature bit="6" code="CL" name="Calibration" summary="Supports the Calibration feature">
<optionalConform>
<feature name="PS"/>
</optionalConform>
</feature>
<feature bit="7" code="PT" name="Protection" summary="Supports the Protection feature">
<optionalConform/>
</feature>
<feature bit="8" code="MO" name="ManuallyOperable" summary="Supports the manual operation feature">
<optionalConform/>
</feature>
<feature bit="9" code="FB" name="Fallback" summary="Supports the fallback feature">
<optionalConform>
<feature name="PS"/>
</optionalConform>
</feature>
</features>
</cluster>
</configurator>
Loading
Loading