Skip to content

Commit a12a0c0

Browse files
[XML] Add Matter 1.4 Switch cluster AS feature (#33927)
* Add AS feature to switch cluster XML * ZAP regen * Force push forcer
1 parent ad344f5 commit a12a0c0

File tree

16 files changed

+44
-10
lines changed

16 files changed

+44
-10
lines changed

examples/all-clusters-app/all-clusters-common/all-clusters-app.matter

+1
Original file line numberDiff line numberDiff line change
@@ -2257,6 +2257,7 @@ cluster Switch = 59 {
22572257
kMomentarySwitchRelease = 0x4;
22582258
kMomentarySwitchLongPress = 0x8;
22592259
kMomentarySwitchMultiPress = 0x10;
2260+
kActionSwitch = 0x20;
22602261
}
22612262

22622263
info event SwitchLatched = 0 {

examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter

+1
Original file line numberDiff line numberDiff line change
@@ -1989,6 +1989,7 @@ cluster Switch = 59 {
19891989
kMomentarySwitchRelease = 0x4;
19901990
kMomentarySwitchLongPress = 0x8;
19911991
kMomentarySwitchMultiPress = 0x10;
1992+
kActionSwitch = 0x20;
19921993
}
19931994

19941995
info event SwitchLatched = 0 {

examples/bridge-app/bridge-common/bridge-app.matter

+1
Original file line numberDiff line numberDiff line change
@@ -1574,6 +1574,7 @@ cluster Switch = 59 {
15741574
kMomentarySwitchRelease = 0x4;
15751575
kMomentarySwitchLongPress = 0x8;
15761576
kMomentarySwitchMultiPress = 0x10;
1577+
kActionSwitch = 0x20;
15771578
}
15781579

15791580
info event SwitchLatched = 0 {

examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter

+1
Original file line numberDiff line numberDiff line change
@@ -954,6 +954,7 @@ cluster Switch = 59 {
954954
kMomentarySwitchRelease = 0x4;
955955
kMomentarySwitchLongPress = 0x8;
956956
kMomentarySwitchMultiPress = 0x10;
957+
kActionSwitch = 0x20;
957958
}
958959

959960
info event SwitchLatched = 0 {

examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter

+1
Original file line numberDiff line numberDiff line change
@@ -954,6 +954,7 @@ cluster Switch = 59 {
954954
kMomentarySwitchRelease = 0x4;
955955
kMomentarySwitchLongPress = 0x8;
956956
kMomentarySwitchMultiPress = 0x10;
957+
kActionSwitch = 0x20;
957958
}
958959

959960
info event SwitchLatched = 0 {

examples/light-switch-app/light-switch-common/light-switch-app.matter

+1
Original file line numberDiff line numberDiff line change
@@ -1600,6 +1600,7 @@ cluster Switch = 59 {
16001600
kMomentarySwitchRelease = 0x4;
16011601
kMomentarySwitchLongPress = 0x8;
16021602
kMomentarySwitchMultiPress = 0x10;
1603+
kActionSwitch = 0x20;
16031604
}
16041605

16051606
info event SwitchLatched = 0 {

examples/light-switch-app/qpg/zap/switch.matter

+1
Original file line numberDiff line numberDiff line change
@@ -1397,6 +1397,7 @@ cluster Switch = 59 {
13971397
kMomentarySwitchRelease = 0x4;
13981398
kMomentarySwitchLongPress = 0x8;
13991399
kMomentarySwitchMultiPress = 0x10;
1400+
kActionSwitch = 0x20;
14001401
}
14011402

14021403
info event SwitchLatched = 0 {

examples/lighting-app/lighting-common/lighting-app.matter

+1
Original file line numberDiff line numberDiff line change
@@ -1506,6 +1506,7 @@ cluster Switch = 59 {
15061506
kMomentarySwitchRelease = 0x4;
15071507
kMomentarySwitchLongPress = 0x8;
15081508
kMomentarySwitchMultiPress = 0x10;
1509+
kActionSwitch = 0x20;
15091510
}
15101511

15111512
info event SwitchLatched = 0 {

examples/placeholder/linux/apps/app1/config.matter

+2
Original file line numberDiff line numberDiff line change
@@ -2375,6 +2375,7 @@ cluster Switch = 59 {
23752375
kMomentarySwitchRelease = 0x4;
23762376
kMomentarySwitchLongPress = 0x8;
23772377
kMomentarySwitchMultiPress = 0x10;
2378+
kActionSwitch = 0x20;
23782379
}
23792380

23802381
info event SwitchLatched = 0 {
@@ -2430,6 +2431,7 @@ cluster Switch = 59 {
24302431
kMomentarySwitchRelease = 0x4;
24312432
kMomentarySwitchLongPress = 0x8;
24322433
kMomentarySwitchMultiPress = 0x10;
2434+
kActionSwitch = 0x20;
24332435
}
24342436

24352437
info event SwitchLatched = 0 {

examples/placeholder/linux/apps/app2/config.matter

+2
Original file line numberDiff line numberDiff line change
@@ -2332,6 +2332,7 @@ cluster Switch = 59 {
23322332
kMomentarySwitchRelease = 0x4;
23332333
kMomentarySwitchLongPress = 0x8;
23342334
kMomentarySwitchMultiPress = 0x10;
2335+
kActionSwitch = 0x20;
23352336
}
23362337

23372338
info event SwitchLatched = 0 {
@@ -2387,6 +2388,7 @@ cluster Switch = 59 {
23872388
kMomentarySwitchRelease = 0x4;
23882389
kMomentarySwitchLongPress = 0x8;
23892390
kMomentarySwitchMultiPress = 0x10;
2391+
kActionSwitch = 0x20;
23902392
}
23912393

23922394
info event SwitchLatched = 0 {

scripts/py_matter_idl/matter_idl/generators/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ def internal_render_one_output(self, template_path: str, output_file_name: str,
168168
if self.dry_run:
169169
return
170170

171+
logging.info(f"Template path: {template_path}, CWD: {os.getcwd()}")
171172
rendered = self.jinja_env.get_template(template_path).render(vars)
172173

173174
# Report regardless if it has changed or not. This is because even if

src/app/zap-templates/zcl/data-model/chip/switch-cluster.xml

+27-10
Original file line numberDiff line numberDiff line change
@@ -37,27 +37,45 @@ Interactions with the switch device are exposed as attributes (for the latching
3737
<feature bit="1" code="MS" name="MomentarySwitch" summary="Switch is momentary">
3838
<optionalConform choice="a"/>
3939
</feature>
40-
<feature bit="2" code="MSR" name="MomentarySwitchRelease" summary="Switch supports release">
41-
<optionalConform>
42-
<feature name="MS"/>
43-
</optionalConform>
44-
</feature>
45-
<feature bit="3" code="MSL" name="MomentarySwitchLongPress" summary="Switch supports long press">
40+
<feature bit="2" code="MSR" name="MomentarySwitchRelease" summary="Switch supports release events generation">
4641
<optionalConform>
4742
<andTerm>
4843
<feature name="MS"/>
49-
<feature name="MSR"/>
44+
<notTerm>
45+
<feature name="AS"/>
46+
</notTerm>
5047
</andTerm>
5148
</optionalConform>
5249
</feature>
53-
<feature bit="4" code="MSM" name="MomentarySwitchMultiPress" summary="Switch supports multi-press">
50+
<feature bit="3" code="MSL" name="MomentarySwitchLongPress" summary="Switch supports long press detection">
5451
<optionalConform>
5552
<andTerm>
5653
<feature name="MS"/>
57-
<feature name="MSR"/>
54+
<orTerm>
55+
<feature name="MSR"/>
56+
<feature name="AS"/>
57+
</orTerm>
5858
</andTerm>
5959
</optionalConform>
6060
</feature>
61+
<feature bit="4" code="MSM" name="MomentarySwitchMultiPress" summary="Switch supports multi-press detection">
62+
<otherwiseConform>
63+
<mandatoryConform>
64+
<feature name="AS"/>
65+
</mandatoryConform>
66+
<optionalConform>
67+
<andTerm>
68+
<feature name="MS"/>
69+
<feature name="MSR"/>
70+
</andTerm>
71+
</optionalConform>
72+
</otherwiseConform>
73+
</feature>
74+
<feature bit="5" code="AS" name="ActionSwitch" apiMaturity="provisional" summary="Switch is momentary, targeted at specific user actions (focus on multi-press and optionally long press) with a reduced event generation scheme">
75+
<optionalConform>
76+
<feature name="MS"/>
77+
</optionalConform>
78+
</feature>
6179
</features>
6280

6381
<attribute side="server" code="0x0000" define="NUMBER_OF_POSITIONS" type="int8u" writable="false" optional="false" default="2" min="2">NumberOfPositions</attribute>
@@ -96,5 +114,4 @@ Interactions with the switch device are exposed as attributes (for the latching
96114

97115
</cluster>
98116

99-
100117
</configurator>

src/controller/data_model/controller-clusters.matter

+1
Original file line numberDiff line numberDiff line change
@@ -2280,6 +2280,7 @@ cluster Switch = 59 {
22802280
kMomentarySwitchRelease = 0x4;
22812281
kMomentarySwitchLongPress = 0x8;
22822282
kMomentarySwitchMultiPress = 0x10;
2283+
kActionSwitch = 0x20;
22832284
}
22842285

22852286
info event SwitchLatched = 0 {

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

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

zzz_generated/app-common/app-common/zap-generated/cluster-enums.h

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)