Skip to content

Commit

Permalink
Add optional CumulativeEnergyReset attribute to EEM
Browse files Browse the repository at this point in the history
  • Loading branch information
hasty committed Jan 31, 2024
1 parent a730bf4 commit 5ac33e5
Show file tree
Hide file tree
Showing 40 changed files with 1,033 additions and 234 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4012,6 +4012,13 @@ provisional cluster ElectricalEnergyMeasurement = 145 {
MeasurementAccuracyRangeStruct accuracyRanges[] = 4;
}

struct CumulativeEnergyResetStruct {
optional nullable epoch_s importedResetTimestamp = 0;
optional nullable epoch_s exportedResetTimestamp = 1;
optional nullable systime_ms importedResetSystime = 2;
optional nullable systime_ms exportedResetSystime = 3;
}

struct EnergyMeasurementStruct {
energy_mwh energy = 0;
optional epoch_s startTimestamp = 1;
Expand All @@ -4035,6 +4042,7 @@ provisional cluster ElectricalEnergyMeasurement = 145 {
readonly attribute optional nullable EnergyMeasurementStruct cumulativeEnergyExported = 2;
readonly attribute optional nullable EnergyMeasurementStruct periodicEnergyImported = 3;
readonly attribute optional nullable EnergyMeasurementStruct periodicEnergyExported = 4;
readonly attribute optional nullable CumulativeEnergyResetStruct cumulativeEnergyReset = 5;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
Expand Down Expand Up @@ -8225,6 +8233,7 @@ endpoint 1 {
callback attribute cumulativeEnergyExported;
callback attribute periodicEnergyImported;
callback attribute periodicEnergyExported;
callback attribute cumulativeEnergyReset;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
Expand Down
82 changes: 49 additions & 33 deletions examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@
}
],
"package": [
{
"pathRelativity": "relativeToZap",
"path": "../../../src/app/zap-templates/app-templates.json",
"type": "gen-templates-json",
"version": "chip-v1"
},
{
"pathRelativity": "relativeToZap",
"path": "../../../src/app/zap-templates/zcl/zcl-with-test-extensions.json",
"type": "zcl-properties",
"category": "matter",
"version": 1,
"description": "Matter SDK ZCL data with some extensions"
},
{
"pathRelativity": "relativeToZap",
"path": "../../../src/app/zap-templates/app-templates.json",
"type": "gen-templates-json",
"version": "chip-v1"
}
],
"endpointTypes": [
Expand Down Expand Up @@ -9511,7 +9511,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down Expand Up @@ -9667,7 +9667,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down Expand Up @@ -11363,7 +11363,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down Expand Up @@ -12709,7 +12709,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -12725,7 +12725,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -12741,7 +12741,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -12757,7 +12757,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -12773,7 +12773,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -12789,7 +12789,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -12805,7 +12805,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -12821,7 +12821,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -12837,7 +12837,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -12853,7 +12853,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -12869,7 +12869,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -12885,7 +12885,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -12901,7 +12901,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -12917,7 +12917,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -12933,7 +12933,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -12949,7 +12949,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -12965,7 +12965,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -12981,7 +12981,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -12997,7 +12997,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -13013,7 +13013,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -13029,7 +13029,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -13045,7 +13045,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -13061,7 +13061,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -13077,7 +13077,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "0",
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down Expand Up @@ -13199,6 +13199,22 @@
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "CumulativeEnergyReset",
"code": 5,
"mfgCode": null,
"side": "server",
"type": "CumulativeEnergyResetStruct",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "GeneratedCommandList",
"code": 65528,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ void emberAfElectricalEnergyMeasurementClusterInitCallback(chip::EndpointId endp
VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1.
VerifyOrDie(!gAttrAccess);

gAttrAccess = std::make_unique<ElectricalEnergyMeasurementAttrAccess>(BitMask<Feature, uint32_t>(
Feature::kImportedEnergy, Feature::kExportedEnergy, Feature::kCumulativeEnergy, Feature::kPeriodicEnergy));
gAttrAccess = std::make_unique<ElectricalEnergyMeasurementAttrAccess>(
BitMask<Feature, uint32_t>(Feature::kImportedEnergy, Feature::kExportedEnergy, Feature::kCumulativeEnergy,
Feature::kPeriodicEnergy),
BitMask<OptionalAttributes, uint32_t>(OptionalAttributes::kOptionalAttributeCumulativeEnergyReset));

if (gAttrAccess)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,13 @@ provisional cluster ElectricalEnergyMeasurement = 145 {
MeasurementAccuracyRangeStruct accuracyRanges[] = 4;
}

struct CumulativeEnergyResetStruct {
optional nullable epoch_s importedResetTimestamp = 0;
optional nullable epoch_s exportedResetTimestamp = 1;
optional nullable systime_ms importedResetSystime = 2;
optional nullable systime_ms exportedResetSystime = 3;
}

struct EnergyMeasurementStruct {
energy_mwh energy = 0;
optional epoch_s startTimestamp = 1;
Expand All @@ -971,6 +978,7 @@ provisional cluster ElectricalEnergyMeasurement = 145 {
readonly attribute optional nullable EnergyMeasurementStruct cumulativeEnergyExported = 2;
readonly attribute optional nullable EnergyMeasurementStruct periodicEnergyImported = 3;
readonly attribute optional nullable EnergyMeasurementStruct periodicEnergyExported = 4;
readonly attribute optional nullable CumulativeEnergyResetStruct cumulativeEnergyReset = 5;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
Expand Down
Loading

0 comments on commit 5ac33e5

Please sign in to comment.