Skip to content

Commit

Permalink
Enable power source cluster to NRF board contact sensor chef-devices (p…
Browse files Browse the repository at this point in the history
…roject-chip#32916)

* chef-add-batery2nrf-324031858

* revert type define changes

* new attributes default value

* remote event list attribute

* update attribute values

* update attributes
  • Loading branch information
stingchang authored Apr 11, 2024
1 parent 1fdd217 commit 1db304a
Show file tree
Hide file tree
Showing 4 changed files with 881 additions and 12 deletions.
21 changes: 17 additions & 4 deletions examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter
Original file line number Diff line number Diff line change
Expand Up @@ -2114,6 +2114,7 @@ endpoint 0 {
}
}
endpoint 1 {
device type ma_powersource = 17, version 1;
device type ma_contactsensor = 21, version 1;


Expand All @@ -2122,11 +2123,13 @@ endpoint 1 {
ram attribute identifyType default = 0x0;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 2;

handle command Identify;
handle command TriggerEffect;
}

server cluster Descriptor {
Expand All @@ -2142,15 +2145,25 @@ endpoint 1 {
}

server cluster PowerSource {
ram attribute status;
ram attribute order;
ram attribute description;
ram attribute status default = 1;
ram attribute order default = 1;
ram attribute description default = "Primary Battery";
ram attribute batVoltage default = 4100;
ram attribute batPercentRemaining default = 95;
ram attribute batTimeRemaining default = 5184000;
ram attribute batChargeLevel default = 0;
ram attribute batReplacementNeeded default = 0;
ram attribute batReplaceability default = 1;
ram attribute batPresent default = 1;
ram attribute batCapacity default = 350;
ram attribute batChargeState default = 4;
ram attribute batFunctionalWhileCharging default = 1;
callback attribute endpointList;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 0;
ram attribute featureMap default = 0x06;
ram attribute clusterRevision default = 1;
}

Expand Down
204 changes: 198 additions & 6 deletions examples/chef/devices/rootnode_contactsensor_27f76aeaf5.zap
Original file line number Diff line number Diff line change
Expand Up @@ -2316,13 +2316,21 @@
"profileId": 259,
"label": "MA-contactsensor",
"name": "MA-contactsensor"
},
{
"code": 17,
"profileId": 259,
"label": "MA-powersource",
"name": "MA-powersource"
}
],
"deviceVersions": [
1,
1
],
"deviceIdentifiers": [
21
21,
17
],
"deviceTypeName": "MA-contactsensor",
"deviceTypeCode": 21,
Expand All @@ -2343,6 +2351,14 @@
"source": "client",
"isIncoming": 1,
"isEnabled": 1
},
{
"name": "TriggerEffect",
"code": 64,
"mfgCode": null,
"source": "client",
"isIncoming": 1,
"isEnabled": 1
}
],
"attributes": [
Expand Down Expand Up @@ -2410,6 +2426,22 @@
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "EventList",
"code": 65530,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "AttributeList",
"code": 65531,
Expand Down Expand Up @@ -2632,7 +2664,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": "1",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -2648,7 +2680,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": "1",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -2664,7 +2696,167 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": "Primary Battery",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "BatVoltage",
"code": 11,
"mfgCode": null,
"side": "server",
"type": "int32u",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "4100",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "BatPercentRemaining",
"code": 12,
"mfgCode": null,
"side": "server",
"type": "int8u",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "95",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "BatTimeRemaining",
"code": 13,
"mfgCode": null,
"side": "server",
"type": "int32u",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "5184000",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "BatChargeLevel",
"code": 14,
"mfgCode": null,
"side": "server",
"type": "BatChargeLevelEnum",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "BatReplacementNeeded",
"code": 15,
"mfgCode": null,
"side": "server",
"type": "boolean",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "BatReplaceability",
"code": 16,
"mfgCode": null,
"side": "server",
"type": "BatReplaceabilityEnum",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "1",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "BatPresent",
"code": 17,
"mfgCode": null,
"side": "server",
"type": "boolean",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "1",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "BatCapacity",
"code": 24,
"mfgCode": null,
"side": "server",
"type": "int32u",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "350",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "BatChargeState",
"code": 26,
"mfgCode": null,
"side": "server",
"type": "BatChargeStateEnum",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "4",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "BatFunctionalWhileCharging",
"code": 28,
"mfgCode": null,
"side": "server",
"type": "boolean",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "1",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down Expand Up @@ -2760,7 +2952,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0",
"defaultValue": "0x06",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down Expand Up @@ -4525,7 +4717,7 @@
{
"endpointTypeName": "Anonymous Endpoint Type",
"endpointTypeIndex": 1,
"profileId": 260,
"profileId": 259,
"endpointId": 1,
"networkId": 0,
"parentEndpointIdentifier": null
Expand Down
Loading

0 comments on commit 1db304a

Please sign in to comment.