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

[XML] Add Matter 1.4 Switch cluster AS feature #33927

Merged
merged 3 commits into from
Jun 14, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -2257,6 +2257,7 @@ cluster Switch = 59 {
kMomentarySwitchRelease = 0x4;
kMomentarySwitchLongPress = 0x8;
kMomentarySwitchMultiPress = 0x10;
kActionSwitch = 0x20;
}

info event SwitchLatched = 0 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1989,6 +1989,7 @@ cluster Switch = 59 {
kMomentarySwitchRelease = 0x4;
kMomentarySwitchLongPress = 0x8;
kMomentarySwitchMultiPress = 0x10;
kActionSwitch = 0x20;
}

info event SwitchLatched = 0 {
Expand Down
1 change: 1 addition & 0 deletions examples/bridge-app/bridge-common/bridge-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1574,6 +1574,7 @@ cluster Switch = 59 {
kMomentarySwitchRelease = 0x4;
kMomentarySwitchLongPress = 0x8;
kMomentarySwitchMultiPress = 0x10;
kActionSwitch = 0x20;
}

info event SwitchLatched = 0 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,7 @@ cluster Switch = 59 {
kMomentarySwitchRelease = 0x4;
kMomentarySwitchLongPress = 0x8;
kMomentarySwitchMultiPress = 0x10;
kActionSwitch = 0x20;
}

info event SwitchLatched = 0 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,7 @@ cluster Switch = 59 {
kMomentarySwitchRelease = 0x4;
kMomentarySwitchLongPress = 0x8;
kMomentarySwitchMultiPress = 0x10;
kActionSwitch = 0x20;
}

info event SwitchLatched = 0 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1600,6 +1600,7 @@ cluster Switch = 59 {
kMomentarySwitchRelease = 0x4;
kMomentarySwitchLongPress = 0x8;
kMomentarySwitchMultiPress = 0x10;
kActionSwitch = 0x20;
}

info event SwitchLatched = 0 {
Expand Down
1 change: 1 addition & 0 deletions examples/light-switch-app/qpg/zap/switch.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1397,6 +1397,7 @@ cluster Switch = 59 {
kMomentarySwitchRelease = 0x4;
kMomentarySwitchLongPress = 0x8;
kMomentarySwitchMultiPress = 0x10;
kActionSwitch = 0x20;
}

info event SwitchLatched = 0 {
Expand Down
1 change: 1 addition & 0 deletions examples/lighting-app/lighting-common/lighting-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1506,6 +1506,7 @@ cluster Switch = 59 {
kMomentarySwitchRelease = 0x4;
kMomentarySwitchLongPress = 0x8;
kMomentarySwitchMultiPress = 0x10;
kActionSwitch = 0x20;
}

info event SwitchLatched = 0 {
Expand Down
2 changes: 2 additions & 0 deletions examples/placeholder/linux/apps/app1/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -2375,6 +2375,7 @@ cluster Switch = 59 {
kMomentarySwitchRelease = 0x4;
kMomentarySwitchLongPress = 0x8;
kMomentarySwitchMultiPress = 0x10;
kActionSwitch = 0x20;
}

info event SwitchLatched = 0 {
Expand Down Expand Up @@ -2430,6 +2431,7 @@ cluster Switch = 59 {
kMomentarySwitchRelease = 0x4;
kMomentarySwitchLongPress = 0x8;
kMomentarySwitchMultiPress = 0x10;
kActionSwitch = 0x20;
}

info event SwitchLatched = 0 {
Expand Down
2 changes: 2 additions & 0 deletions examples/placeholder/linux/apps/app2/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -2332,6 +2332,7 @@ cluster Switch = 59 {
kMomentarySwitchRelease = 0x4;
kMomentarySwitchLongPress = 0x8;
kMomentarySwitchMultiPress = 0x10;
kActionSwitch = 0x20;
}

info event SwitchLatched = 0 {
Expand Down Expand Up @@ -2387,6 +2388,7 @@ cluster Switch = 59 {
kMomentarySwitchRelease = 0x4;
kMomentarySwitchLongPress = 0x8;
kMomentarySwitchMultiPress = 0x10;
kActionSwitch = 0x20;
}

info event SwitchLatched = 0 {
Expand Down
1 change: 1 addition & 0 deletions scripts/py_matter_idl/matter_idl/generators/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ def internal_render_one_output(self, template_path: str, output_file_name: str,
if self.dry_run:
return

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

# Report regardless if it has changed or not. This is because even if
Expand Down
37 changes: 27 additions & 10 deletions src/app/zap-templates/zcl/data-model/chip/switch-cluster.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,45 @@ Interactions with the switch device are exposed as attributes (for the latching
<feature bit="1" code="MS" name="MomentarySwitch" summary="Switch is momentary">
<optionalConform choice="a"/>
</feature>
<feature bit="2" code="MSR" name="MomentarySwitchRelease" summary="Switch supports release">
<optionalConform>
<feature name="MS"/>
</optionalConform>
</feature>
<feature bit="3" code="MSL" name="MomentarySwitchLongPress" summary="Switch supports long press">
<feature bit="2" code="MSR" name="MomentarySwitchRelease" summary="Switch supports release events generation">
<optionalConform>
<andTerm>
<feature name="MS"/>
<feature name="MSR"/>
<notTerm>
<feature name="AS"/>
</notTerm>
</andTerm>
</optionalConform>
</feature>
<feature bit="4" code="MSM" name="MomentarySwitchMultiPress" summary="Switch supports multi-press">
<feature bit="3" code="MSL" name="MomentarySwitchLongPress" summary="Switch supports long press detection">
<optionalConform>
<andTerm>
<feature name="MS"/>
<feature name="MSR"/>
<orTerm>
<feature name="MSR"/>
<feature name="AS"/>
</orTerm>
</andTerm>
</optionalConform>
</feature>
<feature bit="4" code="MSM" name="MomentarySwitchMultiPress" summary="Switch supports multi-press detection">
<otherwiseConform>
<mandatoryConform>
<feature name="AS"/>
</mandatoryConform>
<optionalConform>
<andTerm>
<feature name="MS"/>
<feature name="MSR"/>
</andTerm>
</optionalConform>
</otherwiseConform>
</feature>
<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">
<optionalConform>
<feature name="MS"/>
</optionalConform>
</feature>
</features>

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

</cluster>


</configurator>
1 change: 1 addition & 0 deletions src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -2280,6 +2280,7 @@ cluster Switch = 59 {
kMomentarySwitchRelease = 0x4;
kMomentarySwitchLongPress = 0x8;
kMomentarySwitchMultiPress = 0x10;
kActionSwitch = 0x20;
}

info event SwitchLatched = 0 {
Expand Down
1 change: 1 addition & 0 deletions src/controller/python/chip/clusters/Objects.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading