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

Closures: Closure dimension cluster xml and zap code generation with Alchemy #37989

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
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
1 change: 1 addition & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ jobs:
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
1 change: 1 addition & 0 deletions docs/ids_and_codes/zap_clusters.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ Generally regenerate using one of:
| 257 | 0x101 | DoorLock |
| 258 | 0x102 | WindowCovering |
| 260 | 0x104 | ClosureControl |
| 261 | 0x105 | ClosureDimension |
| 336 | 0x150 | ServiceArea |
| 512 | 0x200 | PumpConfigurationAndControl |
| 513 | 0x201 | Thermostat |
Expand Down
1 change: 1 addition & 0 deletions scripts/rules.matterlint
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ 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
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
#define MATTER_DM_DOOR_LOCK_CLUSTER_SERVER_ENDPOINT_COUNT (0)
#define MATTER_DM_WINDOW_COVERING_CLUSTER_SERVER_ENDPOINT_COUNT (1)
#define MATTER_DM_CLOSURE_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (0)
#define MATTER_DM_CLOSURE_DIMENSION_CLUSTER_SERVER_ENDPOINT_COUNT (0)
#define MATTER_DM_SERVICE_AREA_CLUSTER_SERVER_ENDPOINT_COUNT (0)
#define MATTER_DM_PUMP_CONFIGURATION_AND_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (1)
#define MATTER_DM_THERMOSTAT_CLUSTER_SERVER_ENDPOINT_COUNT (1)
Expand Down Expand Up @@ -232,6 +233,7 @@
#define MATTER_DM_DOOR_LOCK_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
#define MATTER_DM_WINDOW_COVERING_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
#define MATTER_DM_CLOSURE_CONTROL_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
#define MATTER_DM_CLOSURE_DIMENSION_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
#define MATTER_DM_SERVICE_AREA_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
#define MATTER_DM_PUMP_CONFIGURATION_AND_CONTROL_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
#define MATTER_DM_THERMOSTAT_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
#define MATTER_DM_DOOR_LOCK_CLUSTER_SERVER_ENDPOINT_COUNT (0)
#define MATTER_DM_WINDOW_COVERING_CLUSTER_SERVER_ENDPOINT_COUNT (0)
#define MATTER_DM_CLOSURE_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (0)
#define MATTER_DM_CLOSURE_DIMENSION_CLUSTER_SERVER_ENDPOINT_COUNT (0)
#define MATTER_DM_SERVICE_AREA_CLUSTER_SERVER_ENDPOINT_COUNT (0)
#define MATTER_DM_PUMP_CONFIGURATION_AND_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (0)
#define MATTER_DM_THERMOSTAT_CLUSTER_SERVER_ENDPOINT_COUNT (0)
Expand Down Expand Up @@ -232,6 +233,7 @@
#define MATTER_DM_DOOR_LOCK_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
#define MATTER_DM_WINDOW_COVERING_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
#define MATTER_DM_CLOSURE_CONTROL_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
#define MATTER_DM_CLOSURE_DIMENSION_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
#define MATTER_DM_SERVICE_AREA_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
#define MATTER_DM_PUMP_CONFIGURATION_AND_CONTROL_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
#define MATTER_DM_THERMOSTAT_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
Expand Down
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/ClosureDimension.adoc
Parameters: in-progress
Git: 0.7-summer-2025-513-g8ca88d0f5
-->
<configurator xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../zcl.xsd">
<domain name="Closures"/>
<enum name="ClosureUnitEnum" type="enum8">
<cluster code="0x0105"/>
<item name="Millimeter" value="0x00"/>
<item name="Degree" value="0x01"/>
</enum>

<enum name="LatchingEnum" type="enum8">
<cluster code="0x0105"/>
<item name="LatchedAndSecured" value="0x00"/>
<item name="LatchedButNotSecured" value="0x01"/>
<item name="NotLatched" value="0x02"/>
</enum>

<enum name="ModulationTypeEnum" type="enum8">
<cluster code="0x0105"/>
<item name="SlatsOrientation" value="0x00"/>
<item name="SlatsOpenwork" value="0x01"/>
<item name="StripesAlignment" value="0x02"/>
<item name="Opacity" value="0x03"/>
<item name="Ventilation" value="0x04"/>
</enum>

<enum name="OverflowEnum" type="enum8">
<cluster code="0x0105"/>
<item name="NoOverflow" value="0x00"/>
<item name="Inside" value="0x01"/>
<item name="Outside" value="0x02"/>
<item name="TopInside" value="0x03"/>
<item name="TopOutside" value="0x04"/>
<item name="BottomInside" value="0x05"/>
<item name="BottomOutside" value="0x06"/>
<item name="LeftInside" value="0x07"/>
<item name="LeftOutside" value="0x08"/>
<item name="RightInside" value="0x09"/>
<item name="RightOutside" value="0x0A"/>
</enum>

<enum name="RotationAxisEnum" type="enum8">
<cluster code="0x0105"/>
<item name="Left" value="0x00"/>
<item name="CenteredVertical" value="0x01"/>
<item name="LeftAndRight" value="0x02"/>
<item name="Right" value="0x03"/>
<item name="Top" value="0x04"/>
<item name="CenteredHorizontal" value="0x05"/>
<item name="TopAndBottom" value="0x06"/>
<item name="Bottom" value="0x07"/>
<item name="LeftBarrier" value="0x08"/>
<item name="LeftAndRightBarriers" value="0x09"/>
<item name="RightBarrier" value="0x0A"/>
</enum>

<enum name="StepDirectionEnum" type="enum8">
<cluster code="0x0105"/>
<item name="Decrease" value="0x00"/>
<item name="Increase" value="0x01"/>
</enum>

<enum name="TargetLatchEnum" type="enum8">
<cluster code="0x0105"/>
<item name="Latch" value="0x00"/>
<item name="Unlatch" value="0x01"/>
</enum>

<enum name="TranslationDirectionEnum" type="enum8">
<cluster code="0x0105"/>
<item name="Downward" value="0x00"/>
<item name="Upward" value="0x01"/>
<item name="VerticalMask" value="0x02"/>
<item name="VerticalSymmetry" value="0x03"/>
<item name="Leftward" value="0x04"/>
<item name="Rightward" value="0x05"/>
<item name="HorizontalMask" value="0x06"/>
<item name="HorizontalSymmetry" value="0x07"/>
<item name="Forward" value="0x08"/>
<item name="Backward" value="0x09"/>
<item name="DepthMask" value="0x0A"/>
<item name="DepthSymmetry" value="0x0B"/>
<item name="CeilingSimple" value="0x0C"/>
<item name="CeilingMask" value="0x0D"/>
<item name="CeilingSidedSymmetry" value="0x0E"/>
<item name="CeilingCenteredSymmetry" value="0x0F"/>
</enum>

<struct name="CurrentStruct" apiMaturity="provisional">
<cluster code="0x0105"/>
<item fieldId="0" name="Position" type="percent100ths" optional="true"/>
<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"/>
</struct>

<struct name="RangePercent100thsStruct" apiMaturity="provisional">
<cluster code="0x0105"/>
<item fieldId="0" name="Min" type="percent100ths"/>
<item fieldId="1" name="Max" type="percent100ths" max="10000"/>
</struct>

<struct name="TargetStruct" apiMaturity="provisional">
<cluster code="0x0105"/>
<item fieldId="0" name="Position" type="percent100ths" optional="true"/>
<item fieldId="1" name="Latch" type="TargetLatchEnum" optional="true" default="0x01" min="0x00" max="0x01"/>
<item fieldId="2" name="Speed" type="ThreeLevelAutoEnum" optional="true" default="0x00" min="0x00" max="0x03"/>
</struct>

<struct name="UnitRangeStruct" apiMaturity="provisional">
<cluster code="0x0105"/>
<item fieldId="0" name="Min" type="int16s"/>
<item fieldId="1" name="Max" type="int16s" max="32767"/>
</struct>

<cluster apiMaturity="provisional">
<domain>Closures</domain>
<name>Closure Dimension</name>
<code>0x0105</code>
<define>CLOSURE_DIMENSION_CLUSTER</define>
<description>Ceiling values are dedicated for closures that close a ceiling, such as horizontal awnings, pergolas, etc.</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="CURRENT" type="CurrentStruct" isNullable="true">Current</attribute>
<attribute code="0x0001" side="server" define="TARGET" type="TargetStruct" isNullable="true">Target</attribute>
<attribute code="0x0002" side="server" define="RESOLUTION" type="percent100ths" min="0" optional="true">
<description>Resolution</description>
<mandatoryConform>
<feature name="PS"/>
</mandatoryConform>
</attribute>
<attribute code="0x0003" side="server" define="STEP_VALUE" type="percent100ths" optional="true">
<description>StepValue</description>
<mandatoryConform>
<feature name="PS"/>
</mandatoryConform>
</attribute>
<attribute code="0x0004" side="server" define="UNIT" type="ClosureUnitEnum" min="0x00" max="0x01" optional="true">
<description>Unit</description>
<mandatoryConform>
<feature name="UT"/>
</mandatoryConform>
</attribute>
<attribute code="0x0005" side="server" define="UNIT_RANGE" type="UnitRangeStruct" isNullable="true" optional="true">
<description>UnitRange</description>
<mandatoryConform>
<feature name="UT"/>
</mandatoryConform>
</attribute>
<attribute code="0x0006" side="server" define="LIMIT_RANGE" type="RangePercent100thsStruct" optional="true">
<description>LimitRange</description>
<mandatoryConform>
<feature name="LM"/>
</mandatoryConform>
</attribute>
<attribute code="0x0007" side="server" define="TRANSLATION_DIRECTION" type="TranslationDirectionEnum" min="0x00" max="0x0F" optional="true">
<description>TranslationDirection</description>
<mandatoryConform>
<feature name="TR"/>
</mandatoryConform>
</attribute>
<attribute code="0x0008" side="server" define="ROTATION_AXIS" type="RotationAxisEnum" min="0x00" max="0x0A" optional="true">
<description>RotationAxis</description>
<mandatoryConform>
<feature name="RO"/>
</mandatoryConform>
</attribute>
<attribute code="0x0009" side="server" define="OVERFLOW" type="OverflowEnum" min="0x00" max="0x0A" optional="true">
<description>Overflow</description>
<otherwiseConform>
<mandatoryConform>
<feature name="RO"/>
</mandatoryConform>
<optionalConform>
<feature name="LT"/>
</optionalConform>
</otherwiseConform>
</attribute>
<attribute code="0x000A" side="server" define="MODULATION_TYPE" type="ModulationTypeEnum" min="0x00" max="0x04" optional="true">
<description>ModulationType</description>
<mandatoryConform>
<feature name="MD"/>
</mandatoryConform>
</attribute>
<command code="0x00" source="client" name="SetTarget" optional="false">
<description>Upon receipt, this SHALL move the product&apos;s dimension in the most fitting state following the data as follows: </description>
<arg id="0" name="Position" type="percent100ths" optional="true"/>
<arg id="1" name="Latch" type="TargetLatchEnum" optional="true" min="0x00" max="0x01"/>
<arg id="2" name="Speed" type="ThreeLevelAutoEnum" optional="true" min="0x00" max="0x03"/>
</command>

<command code="0x01" source="client" name="Step" optional="true">
<description>Upon receipt, this SHALL update the Target.Position attribute value e.g. by sending multiple commands with short step by step or a single command with multiple steps.</description>
<arg id="0" name="Direction" type="StepDirectionEnum" min="0x00" max="0x01"/>
<arg id="1" name="NumberOfSteps" type="int16u" min="1"/>
<arg id="2" name="Speed" type="ThreeLevelAutoEnum" optional="true" min="0x00" max="0x03"/>
<mandatoryConform>
<feature name="PS"/>
</mandatoryConform>
</command>

<features>
<feature bit="0" code="PS" name="Positioning" summary="Supports positioning in the range from 0.00% to 100.00%">
<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="UT" name="Unit" summary="Supports additional data (in mm, degrees ...) to enhance control">
<optionalConform>
<feature name="PS"/>
</optionalConform>
</feature>
<feature bit="3" code="LM" name="Limitation" summary="Supports the limitation of the operating range">
<optionalConform>
<feature name="PS"/>
</optionalConform>
</feature>
<feature bit="4" code="SP" name="Speed" summary="Supports speed motion throttling.">
<optionalConform>
<feature name="PS"/>
</optionalConform>
</feature>
<feature bit="5" code="TR" name="Translation" summary="Drives a translation motion">
<optionalConform choice="b">
<feature name="PS"/>
</optionalConform>
</feature>
<feature bit="6" code="RO" name="Rotation" summary="Drives a rotation motion">
<optionalConform choice="b">
<feature name="PS"/>
</optionalConform>
</feature>
<feature bit="7" code="MD" name="Modulation" summary="Modulates a particular flow level (light, air, privacy ...)">
<optionalConform choice="b">
<feature name="PS"/>
</optionalConform>
</feature>
</features>
</cluster>
</configurator>
2 changes: 2 additions & 0 deletions src/app/zap-templates/zcl/zcl-with-test-extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"chip-ota.xml",
"channel-cluster.xml",
"closure-control-cluster.xml",
"closure-dimension-cluster.xml",
"clusters-extensions.xml",
"color-control-cluster.xml",
"commissioner-control-cluster.xml",
Expand Down Expand Up @@ -203,6 +204,7 @@
"Bridged Device Basic Information": ["ProductAppearance"],
"Chime": ["SelectedChime", "Enabled"],
"Closure Control": ["OverallState", "OverallTarget"],
"Closure Dimension": ["Current", "Target", "UnitRange", "LimitRange"],
"Descriptor": ["ClusterRevision", "FeatureMap"],
"Device Energy Management": [
"ESAType",
Expand Down
2 changes: 2 additions & 0 deletions src/app/zap-templates/zcl/zcl.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"chip-ota.xml",
"channel-cluster.xml",
"closure-control-cluster.xml",
"closure-dimension-cluster.xml",
"clusters-extensions.xml",
"color-control-cluster.xml",
"commissioner-control-cluster.xml",
Expand Down Expand Up @@ -197,6 +198,7 @@
"Bridged Device Basic Information": ["ProductAppearance"],
"Chime": ["SelectedChime", "Enabled"],
"Closure Control": ["OverallState", "OverallTarget"],
"Closure Dimension": ["Current", "Target", "UnitRange", "LimitRange"],
"Descriptor": ["ClusterRevision", "FeatureMap"],
"Device Energy Management": [
"ESAType",
Expand Down
2 changes: 2 additions & 0 deletions src/app/zap_cluster_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"CHIME_CLUSTER": [],
"CLIENT_MONITORING_CLUSTER": [],
"CLOSURE_CONTROL_CLUSTER": [],
"CLOSURE_DIMENSION_CLUSTER": [],
"COLOR_CONTROL_CLUSTER": [],
"COMMISSIONER_CONTROL_CLUSTER": [],
"COMMISSIONING_CLUSTER": [],
Expand Down Expand Up @@ -179,6 +180,7 @@
"CHANNEL_CLUSTER": ["channel-server"],
"CHIME_CLUSTER": ["chime-server"],
"CLOSURE_CONTROL_CLUSTER": ["closure-control-server"],
"CLOSURE_DIMENSION_CLUSTER": [],
"COLOR_CONTROL_CLUSTER": ["color-control-server"],
"COMMISSIONER_CONTROL_CLUSTER": ["commissioner-control-server"],
"COMMISSIONING_CLUSTER": [],
Expand Down
Loading
Loading