Skip to content

Commit

Permalink
Update FanControl cluster definition to make it more readable (#17578)
Browse files Browse the repository at this point in the history
  • Loading branch information
yufengwangca authored Apr 21, 2022
1 parent 2b06717 commit 382a6fb
Show file tree
Hide file tree
Showing 17 changed files with 245 additions and 237 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1354,7 +1354,16 @@ server cluster EthernetNetworkDiagnostics = 55 {
}

server cluster FanControl = 514 {
enum FanMode : ENUM8 {
enum FanModeSequenceType : ENUM8 {
kOffLowMedHigh = 0;
kOffLowHigh = 1;
kOffLowMedHighAuto = 2;
kOffLowHighAuto = 3;
kOffOnAuto = 4;
kOffOn = 5;
}

enum FanModeType : ENUM8 {
kOff = 0;
kLow = 1;
kMedium = 2;
Expand All @@ -1364,15 +1373,6 @@ server cluster FanControl = 514 {
kSmart = 6;
}

enum FanModeSequence : ENUM8 {
kOffLowMedHigh = 0;
kOffLowHigh = 1;
kOffLowMedHighAuto = 2;
kOffLowHighAuto = 3;
kOffOnAuto = 4;
kOffOn = 5;
}

bitmap FanControlFeature : BITMAP32 {
kMultiSpeed = 0x1;
kAuto = 0x2;
Expand All @@ -1396,8 +1396,8 @@ server cluster FanControl = 514 {
kNaturalWind = 0x2;
}

attribute enum8 fanMode = 0;
attribute enum8 fanModeSequence = 1;
attribute FanModeType fanMode = 0;
attribute FanModeSequenceType fanModeSequence = 1;
attribute int8u percentSetting = 2;
readonly attribute int8u percentCurrent = 3;
readonly attribute int8u speedMax = 4;
Expand Down
18 changes: 9 additions & 9 deletions src/app/zap-templates/zcl/data-model/silabs/ha.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,20 @@ limitations under the License.
<define>FAN_CONTROL_CLUSTER</define>
<client tick="false" init="false">true</client>
<server tick="false" init="false">true</server>
<attribute side="server" code="0x0000" define="FAN_MODE" type="ENUM8" min="0x00" max="0x06" writable="true" default="0x00" optional="false">fan mode</attribute>
<attribute side="server" code="0x0001" define="FAN_MODE_SEQUENCE" type="ENUM8" min="0x00" max="0x04" writable="true" default="0x02" optional="false">fan mode sequence</attribute>
<attribute side="server" code="0x0002" define="PERCENT_SETTING" type="INT8U" min="0x00" max="0x64" writable="true" default="0x00" optional="false">percent setting</attribute>
<attribute side="server" code="0x0003" define="PERCENT_CURRENT" type="INT8U" min="0x00" max="0x64" writable="false" default="0x00" optional="false">percent current</attribute>
<attribute side="server" code="0x0004" define="SPEED_MAX" type="INT8U" min="0x01" max="0x64" writable="false" default="0x00" optional="true">speed max</attribute>
<attribute side="server" code="0x0005" define="SPEED_SETTING" type="INT8U" min="0x00" max="0x64" writable="true" default="0x00" optional="true">speed setting</attribute>
<attribute side="server" code="0x0006" define="SPEED_CURRENT" type="INT8U" min="0x00" max="0x64" writable="false" default="0x00" optional="true">speed current</attribute>
<attribute side="server" code="0x0000" define="FAN_MODE" type="FanModeType" min="0" max="6" writable="true" default="0" optional="false">fan mode</attribute>
<attribute side="server" code="0x0001" define="FAN_MODE_SEQUENCE" type="FanModeSequenceType" min="0" max="5" writable="true" default="2" optional="false">fan mode sequence</attribute>
<attribute side="server" code="0x0002" define="PERCENT_SETTING" type="INT8U" min="0" max="100" writable="true" default="0" optional="false">percent setting</attribute>
<attribute side="server" code="0x0003" define="PERCENT_CURRENT" type="INT8U" min="0" max="100" writable="false" default="0" optional="false">percent current</attribute>
<attribute side="server" code="0x0004" define="SPEED_MAX" type="INT8U" min="1" max="100" writable="false" default="1" optional="true">speed max</attribute>
<attribute side="server" code="0x0005" define="SPEED_SETTING" type="INT8U" min="0" max="100" writable="true" default="0" optional="true">speed setting</attribute>
<attribute side="server" code="0x0006" define="SPEED_CURRENT" type="INT8U" min="0" max="100" writable="false" default="0" optional="true">speed current</attribute>
<attribute side="server" code="0x0007" define="ROCK_SUPPORT" type="BITMAP8" writable="false" default="0x00" optional="true">rock support</attribute>
<attribute side="server" code="0x0008" define="ROCK_SETTING" type="BITMAP8" writable="true" default="0x00" optional="true">rock setting</attribute>
<attribute side="server" code="0x0009" define="WIND_SUPPORT" type="BITMAP8" writable="false" default="0x00" optional="true">wind support</attribute>
<attribute side="server" code="0x000A" define="WIND_SETTING" type="BITMAP8" writable="true" default="0x00" optional="true">wind setting</attribute>
</cluster>
<!-- Fan Control Cluster data types -->
<enum name="FanMode" type="ENUM8">
<enum name="FanModeType" type="ENUM8">
<cluster code="0x0202"/>
<item name="Off" value="0x00"/>
<item name="Low" value="0x01"/>
Expand All @@ -76,7 +76,7 @@ limitations under the License.
<item name="Auto" value="0x05"/>
<item name="Smart" value="0x06"/>
</enum>
<enum name="FanModeSequence" type="ENUM8">
<enum name="FanModeSequenceType" type="ENUM8">
<cluster code="0x0202"/>
<item name="Off/Low/Med/High" value="0x00"/>
<item name="Off/Low/High" value="0x01"/>
Expand Down
24 changes: 12 additions & 12 deletions src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1703,7 +1703,16 @@ client cluster EthernetNetworkDiagnostics = 55 {
}

client cluster FanControl = 514 {
enum FanMode : ENUM8 {
enum FanModeSequenceType : ENUM8 {
kOffLowMedHigh = 0;
kOffLowHigh = 1;
kOffLowMedHighAuto = 2;
kOffLowHighAuto = 3;
kOffOnAuto = 4;
kOffOn = 5;
}

enum FanModeType : ENUM8 {
kOff = 0;
kLow = 1;
kMedium = 2;
Expand All @@ -1713,15 +1722,6 @@ client cluster FanControl = 514 {
kSmart = 6;
}

enum FanModeSequence : ENUM8 {
kOffLowMedHigh = 0;
kOffLowHigh = 1;
kOffLowMedHighAuto = 2;
kOffLowHighAuto = 3;
kOffOnAuto = 4;
kOffOn = 5;
}

bitmap FanControlFeature : BITMAP32 {
kMultiSpeed = 0x1;
kAuto = 0x2;
Expand All @@ -1745,8 +1745,8 @@ client cluster FanControl = 514 {
kNaturalWind = 0x2;
}

attribute enum8 fanMode = 0;
attribute enum8 fanModeSequence = 1;
attribute FanModeType fanMode = 0;
attribute FanModeSequenceType fanModeSequence = 1;
attribute int8u percentSetting = 2;
readonly attribute int8u percentCurrent = 3;
readonly attribute int8u speedMax = 4;
Expand Down

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

34 changes: 17 additions & 17 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.

32 changes: 16 additions & 16 deletions src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm

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

Loading

0 comments on commit 382a6fb

Please sign in to comment.