Skip to content

Commit

Permalink
[FanControl cluster] Add missing definitions for Fan Control cluster (#…
Browse files Browse the repository at this point in the history
…17416)

* Add missing defination for Fan Control cluster

* Run codegen
  • Loading branch information
yufengwangca authored Apr 15, 2022
1 parent 0680f21 commit 4967c0e
Show file tree
Hide file tree
Showing 35 changed files with 4,466 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1317,8 +1317,59 @@ server cluster EthernetNetworkDiagnostics = 55 {
}

server cluster FanControl = 514 {
enum FanMode : ENUM8 {
kOff = 0;
kLow = 1;
kMedium = 2;
kHigh = 3;
kOn = 4;
kAuto = 5;
kSmart = 6;
}

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

bitmap FanControlFeature : BITMAP32 {
kMultiSpeed = 0x1;
kAuto = 0x2;
kRocking = 0x4;
kWind = 0x8;
}

bitmap RockSupportMask : BITMAP8 {
kRockLeftRight = 0x1;
kRockUpDown = 0x2;
kRockRound = 0x4;
}

bitmap WindSettingMask : BITMAP8 {
kSleepWind = 0x1;
kNaturalWind = 0x2;
}

bitmap WindSupportMask : BITMAP8 {
kSleepWind = 0x1;
kNaturalWind = 0x2;
}

attribute enum8 fanMode = 0;
attribute enum8 fanModeSequence = 1;
attribute int8u percentSetting = 2;
readonly attribute int8u percentCurrent = 3;
readonly attribute int8u speedMax = 4;
attribute int8u speedSetting = 5;
readonly attribute int8u speedCurrent = 6;
readonly attribute bitmap8 rockSupport = 7;
attribute bitmap8 rockSetting = 8;
readonly attribute bitmap8 windSupport = 9;
attribute bitmap8 windSetting = 10;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;
}
Expand Down
140 changes: 138 additions & 2 deletions examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -12987,7 +12987,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x05",
"defaultValue": "0x00",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -13008,6 +13008,141 @@
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "percent setting",
"code": 2,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x00",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "percent current",
"code": 3,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x00",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "speed max",
"code": 4,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x00",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "speed setting",
"code": 5,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x00",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "speed current",
"code": 6,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x00",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "rock support",
"code": 7,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x00",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "rock setting",
"code": 8,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x00",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "wind support",
"code": 9,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x00",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "wind setting",
"code": 10,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x00",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "GeneratedCommandList",
"code": 65528,
Expand Down Expand Up @@ -21690,5 +21825,6 @@
"endpointVersion": 1,
"deviceIdentifier": 61442
}
]
],
"log": []
}
58 changes: 54 additions & 4 deletions src/app/zap-templates/zcl/data-model/silabs/ha.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,61 @@ 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_CONTROL_FAN_MODE" type="ENUM8" min="0x00" max="0x06" writable="true" default="0x05" optional="false">fan mode</attribute>
<!-- FAN_MODE -->
<attribute side="server" code="0x0001" define="FAN_CONTROL_FAN_MODE_SEQUENCE" type="ENUM8" min="0x00" max="0x04" writable="true" default="0x02" optional="false">fan mode sequence</attribute>
<!-- FAN_MODE_SEQUENCE -->
<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="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">
<cluster code="0x0202"/>
<item name="Off" value="0x00"/>
<item name="Low" value="0x01"/>
<item name="Medium" value="0x02"/>
<item name="High" value="0x03"/>
<item name="On" value="0x04"/>
<item name="Auto" value="0x05"/>
<item name="Smart" value="0x06"/>
</enum>
<enum name="FanModeSequence" type="ENUM8">
<cluster code="0x0202"/>
<item name="Off/Low/Med/High" value="0x00"/>
<item name="Off/Low/High" value="0x01"/>
<item name="Off/Low/Med/High/Auto" value="0x02"/>
<item name="Off/Low/High/Auto" value="0x03"/>
<item name="Off/On/Auto" value="0x04"/>
<item name="Off/On" value="0x05"/>
</enum>
<bitmap name="FanControlFeature" type="BITMAP32">
<cluster code="0x0202" />
<field name="MultiSpeed" mask="0x01" />
<field name="Auto" mask="0x02" />
<field name="Rocking" mask="0x04" />
<field name="Wind" mask="0x08" />
</bitmap>
<bitmap name="RockSupportMask" type="BITMAP8">
<cluster code="0x0202" />
<field name="RockLeftRight" mask="0x01" />
<field name="RockUpDown" mask="0x02" />
<field name="RockRound" mask="0x04" />
</bitmap>
<bitmap name="WindSupportMask" type="BITMAP8">
<cluster code="0x0202" />
<field name="SleepWind" mask="0x01" />
<field name="NaturalWind" mask="0x02" />
</bitmap>
<bitmap name="WindSettingMask" type="BITMAP8">
<cluster code="0x0202" />
<field name="SleepWind" mask="0x01" />
<field name="NaturalWind" mask="0x02" />
</bitmap>
<cluster>
<name>Dehumidification Control</name>
<domain>HVAC</domain>
Expand Down
51 changes: 51 additions & 0 deletions src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1700,8 +1700,59 @@ client cluster EthernetNetworkDiagnostics = 55 {
}

client cluster FanControl = 514 {
enum FanMode : ENUM8 {
kOff = 0;
kLow = 1;
kMedium = 2;
kHigh = 3;
kOn = 4;
kAuto = 5;
kSmart = 6;
}

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

bitmap FanControlFeature : BITMAP32 {
kMultiSpeed = 0x1;
kAuto = 0x2;
kRocking = 0x4;
kWind = 0x8;
}

bitmap RockSupportMask : BITMAP8 {
kRockLeftRight = 0x1;
kRockUpDown = 0x2;
kRockRound = 0x4;
}

bitmap WindSettingMask : BITMAP8 {
kSleepWind = 0x1;
kNaturalWind = 0x2;
}

bitmap WindSupportMask : BITMAP8 {
kSleepWind = 0x1;
kNaturalWind = 0x2;
}

attribute enum8 fanMode = 0;
attribute enum8 fanModeSequence = 1;
attribute int8u percentSetting = 2;
readonly attribute int8u percentCurrent = 3;
readonly attribute int8u speedMax = 4;
attribute int8u speedSetting = 5;
readonly attribute int8u speedCurrent = 6;
readonly attribute bitmap8 rockSupport = 7;
attribute bitmap8 rockSetting = 8;
readonly attribute bitmap8 windSupport = 9;
attribute bitmap8 windSetting = 10;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute attrib_id attributeList[] = 65531;
Expand Down
Loading

0 comments on commit 4967c0e

Please sign in to comment.