-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
Copy pathswitch-cluster.xml
151 lines (143 loc) · 6.23 KB
/
switch-cluster.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<?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="2" />
<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 events generation">
<optionalConform>
<andTerm>
<feature name="MS"/>
<notTerm>
<feature name="AS"/>
</notTerm>
</andTerm>
</optionalConform>
</feature>
<feature bit="3" code="MSL" name="MomentarySwitchLongPress" summary="Switch supports long press detection">
<optionalConform>
<andTerm>
<feature name="MS"/>
<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" name="NumberOfPositions" define="NUMBER_OF_POSITIONS" type="int8u" default="2" min="2">
<mandatoryConform/>
</attribute>
<attribute side="server" code="0x0001" name="CurrentPosition" define="CURRENT_POSITION" type="int8u" reportable="true">
<mandatoryConform/>
</attribute>
<attribute side="server" code="0x0002" name="MultiPressMax" define="MULTI_PRESS_MAX" type="int8u" optional="true" default="2" min="2">
<mandatoryConform>
<feature name="MSM"/>
</mandatoryConform>
</attribute>
<event side="server" code="0x00" priority="info" name="SwitchLatched" optional="true">
<description>SwitchLatched</description>
<field id="0" name="NewPosition" type="int8u" />
<mandatoryConform>
<feature name="LS"/>
</mandatoryConform>
</event>
<event side="server" code="0x01" priority="info" name="InitialPress" optional="true">
<description>InitialPress</description>
<field id="0" name="NewPosition" type="int8u" />
<mandatoryConform>
<feature name="MS"/>
</mandatoryConform>
</event>
<event side="server" code="0x02" priority="info" name="LongPress" optional="true">
<description>LongPress</description>
<field id="0" name="NewPosition" type="int8u" />
<mandatoryConform>
<feature name="MSL"/>
</mandatoryConform>
</event>
<event side="server" code="0x03" priority="info" name="ShortRelease" optional="true">
<description>ShortRelease</description>
<field id="0" name="PreviousPosition" type="int8u" />
<mandatoryConform>
<feature name="MSR"/>
</mandatoryConform>
</event>
<event side="server" code="0x04" priority="info" name="LongRelease" optional="true">
<description>LongRelease</description>
<field id="0" name="PreviousPosition" type="int8u" />
<mandatoryConform>
<feature name="MSL"/>
</mandatoryConform>
</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" />
<mandatoryConform>
<andTerm>
<feature name="MSM"/>
<notTerm>
<feature name="AS"/>
</notTerm>
</andTerm>
</mandatoryConform>
</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"/>
<mandatoryConform>
<feature name="MSM"/>
</mandatoryConform>
</event>
</cluster>
</configurator>