| <?xml version="1.0"?> |
| <!-- |
| Copyright (c) 2021 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="CHIP" /> |
| <cluster> |
| <domain>CHIP</domain> |
| <name>Switch</name> |
| <code>0x003b</code> |
| <define>SWITCH_CLUSTER</define> |
| <client init="false" tick="false">true</client> |
| <server init="false" tick="false">true</server> |
| <description>This cluster exposes interactions with a switch device, for the purpose of using those interactions by other devices. |
| Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. |
| Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade.</description> |
| |
| <globalAttribute side="server" code="0xFFFC" value="0" /> |
| <globalAttribute side="either" code="0xFFFD" value="1" /> |
| |
| <features> |
| <feature bit="0" code="LS" name="LatchingSwitch" summary="Switch is latching"> |
| <optionalConform choice="a"/> |
| </feature> |
| <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"> |
| <optionalConform> |
| <andTerm> |
| <feature name="MS"/> |
| <feature name="MSR"/> |
| </andTerm> |
| </optionalConform> |
| </feature> |
| <feature bit="4" code="MSM" name="MomentarySwitchMultiPress" summary="Switch supports multi-press"> |
| <optionalConform> |
| <andTerm> |
| <feature name="MS"/> |
| <feature name="MSR"/> |
| </andTerm> |
| </optionalConform> |
| </feature> |
| </features> |
| |
| <attribute side="server" code="0x0000" define="NUMBER_OF_POSITIONS" type="int8u" writable="false" optional="false" default="2" min="2">NumberOfPositions</attribute> |
| <attribute side="server" code="0x0001" define="CURRENT_POSITION" type="int8u" writable="false" reportable="true" optional="false">CurrentPosition</attribute> |
| <attribute side="server" code="0x0002" define="MULTI_PRESS_MAX" type="int8u" writable="false" optional="true" default="2" min="2">MultiPressMax</attribute> |
| <event side="server" code="0x00" priority="info" name="SwitchLatched" optional="true"> |
| <description>SwitchLatched</description> |
| <field id="0" name="NewPosition" type="int8u" /> |
| </event> |
| <event side="server" code="0x01" priority="info" name="InitialPress" optional="true"> |
| <description>InitialPress</description> |
| <field id="0" name="NewPosition" type="int8u" /> |
| </event> |
| <event side="server" code="0x02" priority="info" name="LongPress" optional="true"> |
| <description>LongPress</description> |
| <field id="0" name="NewPosition" type="int8u" /> |
| </event> |
| <event side="server" code="0x03" priority="info" name="ShortRelease" optional="true"> |
| <description>ShortRelease</description> |
| <field id="0" name="PreviousPosition" type="int8u" /> |
| </event> |
| <event side="server" code="0x04" priority="info" name="LongRelease" optional="true"> |
| <description>LongRelease</description> |
| <field id="0" name="PreviousPosition" type="int8u" /> |
| </event> |
| <event side="server" code="0x05" priority="info" name="MultiPressOngoing" optional="true"> |
| <description>MultiPressOngoing</description> |
| <field id="0" name="NewPosition" type="int8u" /> |
| <field id="1" name="CurrentNumberOfPressesCounted" type="int8u" /> |
| </event> |
| <event side="server" code="0x06" priority="info" name="MultiPressComplete" optional="true"> |
| <description>MultiPressComplete</description> |
| <field id="0" name="PreviousPosition" type="int8u" /> |
| <field id="1" name="TotalNumberOfPressesCounted" type="int8u" /> |
| </event> |
| |
| </cluster> |
| |
| |
| </configurator> |