Skip to content

Commit

Permalink
Power source new attribute (#27969)
Browse files Browse the repository at this point in the history
* Update xml

* PowerSource: Add EndpointList

* Update tests.

* zap lock-app

* zap all-clusters

* zap all-clusters-minimal

* zap lighting-app

* zap placeholder apps

* zap smoke-co-alarm

* zap window-app

* zap test inputs

* Update src/app/zap-templates/zcl/data-model/chip/power-source-cluster.xml

Co-authored-by: Boris Zbarsky <[email protected]>

* Restyled by whitespace

* Restyled by prettier-yaml

* re-run zap after change.

* Remove power config from the descriptor test

* Remove deprecated tests from CI

Apparently the top level pics don't guard anything.

* re-zap

---------

Co-authored-by: Boris Zbarsky <[email protected]>
Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
3 people authored and pull[bot] committed Mar 30, 2024
1 parent 78389c3 commit 1047686
Show file tree
Hide file tree
Showing 57 changed files with 1,000 additions and 762 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1043,17 +1043,6 @@ server cluster UnitLocalization = 45 {
readonly attribute int16u clusterRevision = 65533;
}

/** This cluster is used to describe the configuration and capabilities of a Device's power system. */
server cluster PowerSourceConfiguration = 46 {
readonly attribute INT8U sources[] = 0;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
readonly attribute attrib_id attributeList[] = 65531;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;
}

/** This cluster is used to describe the configuration and capabilities of a physical power source that provides power to the Node. */
server cluster PowerSource = 47 {
enum BatApprovedChemistryEnum : ENUM16 {
Expand Down Expand Up @@ -1277,6 +1266,7 @@ server cluster PowerSource = 47 {
readonly attribute BatChargeLevelEnum batChargeLevel = 14;
readonly attribute boolean batReplacementNeeded = 15;
readonly attribute BatReplaceabilityEnum batReplaceability = 16;
readonly attribute endpoint_no endpointList[] = 31;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
Expand Down Expand Up @@ -5819,21 +5809,16 @@ endpoint 0 {
ram attribute clusterRevision default = 1;
}

server cluster PowerSourceConfiguration {
callback attribute sources;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 1;
}

server cluster PowerSource {
ram attribute status default = 0;
ram attribute order default = 3;
ram attribute description default = "B1";
ram attribute batChargeLevel default = 0;
ram attribute batReplacementNeeded;
ram attribute batReplaceability;
callback attribute endpointList;
ram attribute featureMap default = 2;
ram attribute clusterRevision default = 1;
ram attribute clusterRevision default = 2;
}

server cluster GeneralCommissioning {
Expand Down Expand Up @@ -6200,8 +6185,9 @@ endpoint 1 {
ram attribute batChargeLevel default = 0;
ram attribute batReplacementNeeded;
ram attribute batReplaceability;
callback attribute endpointList;
ram attribute featureMap default = 2;
ram attribute clusterRevision default = 1;
ram attribute clusterRevision default = 2;
}

server cluster Switch {
Expand Down Expand Up @@ -7063,8 +7049,9 @@ endpoint 2 {
ram attribute batChargeLevel default = 0;
ram attribute batReplacementNeeded;
ram attribute batReplaceability;
callback attribute endpointList;
ram attribute featureMap default = 2;
ram attribute clusterRevision default = 1;
ram attribute clusterRevision default = 2;
}

server cluster OccupancySensing {
Expand Down
56 changes: 52 additions & 4 deletions examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -2198,7 +2198,7 @@
"mfgCode": null,
"define": "POWER_SOURCE_CONFIGURATION_CLUSTER",
"side": "server",
"enabled": 1,
"enabled": 0,
"attributes": [
{
"name": "Sources",
Expand Down Expand Up @@ -2762,6 +2762,22 @@
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "EndpointList",
"code": 31,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "GeneratedCommandList",
"code": 65528,
Expand Down Expand Up @@ -2836,7 +2852,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "1",
"defaultValue": "2",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down Expand Up @@ -12341,6 +12357,22 @@
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "EndpointList",
"code": 31,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "GeneratedCommandList",
"code": 65528,
Expand Down Expand Up @@ -12415,7 +12447,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "1",
"defaultValue": "2",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
Expand Down Expand Up @@ -29321,6 +29353,22 @@
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "EndpointList",
"code": 31,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "GeneratedCommandList",
"code": 65528,
Expand Down Expand Up @@ -29395,7 +29443,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "1",
"defaultValue": "2",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -901,17 +901,6 @@ server cluster UnitLocalization = 45 {
readonly attribute int16u clusterRevision = 65533;
}

/** This cluster is used to describe the configuration and capabilities of a Device's power system. */
server cluster PowerSourceConfiguration = 46 {
readonly attribute INT8U sources[] = 0;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
readonly attribute attrib_id attributeList[] = 65531;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;
}

/** This cluster is used to describe the configuration and capabilities of a physical power source that provides power to the Node. */
server cluster PowerSource = 47 {
enum BatApprovedChemistryEnum : ENUM16 {
Expand Down Expand Up @@ -1132,6 +1121,7 @@ server cluster PowerSource = 47 {
readonly attribute PowerSourceStatusEnum status = 0;
readonly attribute int8u order = 1;
readonly attribute char_string<60> description = 2;
readonly attribute endpoint_no endpointList[] = 31;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
Expand Down Expand Up @@ -4051,18 +4041,13 @@ endpoint 0 {
ram attribute clusterRevision default = 1;
}

server cluster PowerSourceConfiguration {
callback attribute sources;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 1;
}

server cluster PowerSource {
ram attribute status default = 0;
ram attribute order default = 3;
ram attribute description default = "B1";
callback attribute endpointList;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 1;
ram attribute clusterRevision default = 2;
}

server cluster GeneralCommissioning {
Expand Down Expand Up @@ -4272,8 +4257,9 @@ endpoint 1 {
ram attribute status default = 0;
ram attribute order default = 2;
ram attribute description default = "B2";
callback attribute endpointList;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 1;
ram attribute clusterRevision default = 2;
}

server cluster Switch {
Expand Down Expand Up @@ -4647,8 +4633,9 @@ endpoint 2 {
ram attribute status default = 0;
ram attribute order default = 1;
ram attribute description default = "B3";
callback attribute endpointList;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 1;
ram attribute clusterRevision default = 2;
}

server cluster OccupancySensing {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2161,7 +2161,7 @@
"mfgCode": null,
"define": "POWER_SOURCE_CONFIGURATION_CLUSTER",
"side": "server",
"enabled": 1,
"enabled": 0,
"attributes": [
{
"name": "Sources",
Expand Down Expand Up @@ -2725,6 +2725,22 @@
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "EndpointList",
"code": 31,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "GeneratedCommandList",
"code": 65528,
Expand Down Expand Up @@ -2799,7 +2815,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "1",
"defaultValue": "2",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down Expand Up @@ -11367,6 +11383,22 @@
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "EndpointList",
"code": 31,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "GeneratedCommandList",
"code": 65528,
Expand Down Expand Up @@ -11441,7 +11473,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "1",
"defaultValue": "2",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
Expand Down Expand Up @@ -23098,6 +23130,22 @@
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "EndpointList",
"code": 31,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "GeneratedCommandList",
"code": 65528,
Expand Down Expand Up @@ -23172,7 +23220,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "1",
"defaultValue": "2",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down
6 changes: 5 additions & 1 deletion examples/darwin-framework-tool/templates/tests/ciTests.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@
"Disabled due to Events verification not supported",
"Test_TC_BINFO_2_2",
"Test_TC_ACL_2_5",
"Test_TC_ACL_2_6"
"Test_TC_ACL_2_6",
"Disabled because the power source configuration cluster is now deprecated and not present in all-clusters",
"Test_TC_PSCFG_1_1",
"Test_TC_PSCFG_2_1",
"Test_TC_PSCFG_2_2"
]
}
Loading

0 comments on commit 1047686

Please sign in to comment.