Skip to content

Commit 3271a8e

Browse files
PeterC1965restyled-commits
andauthoredJun 13, 2024
Update device-energy-management-cluster.xml based on latest cluster spec (#33771)
* Update device-energy-management-cluster.xml based on latest cluster spec and regenerate zap files * Restyled by clang-format * Address comments from Boris Zbarsky * Address some further useful comments from Boris Zbarsky * Restyled by clang-format * Merge from master and regenerate zap files --------- Co-authored-by: Restyled.io <commits@restyled.io>
1 parent b6b9485 commit 3271a8e

File tree

46 files changed

+1749
-857
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1749
-857
lines changed
 

‎examples/all-clusters-app/all-clusters-common/all-clusters-app.matter

+25-14
Original file line numberDiff line numberDiff line change
@@ -4069,7 +4069,7 @@ cluster ElectricalEnergyMeasurement = 145 {
40694069

40704070
/** This cluster allows a client to manage the power draw of a device. An example of such a client could be an Energy Management System (EMS) which controls an Energy Smart Appliance (ESA). */
40714071
provisional cluster DeviceEnergyManagement = 152 {
4072-
revision 3;
4072+
revision 4;
40734073

40744074
enum AdjustmentCauseEnum : enum8 {
40754075
kLocalOptimization = 0;
@@ -4130,6 +4130,12 @@ provisional cluster DeviceEnergyManagement = 152 {
41304130
kOptOut = 3;
41314131
}
41324132

4133+
enum PowerAdjustReasonEnum : enum8 {
4134+
kNoAdjustment = 0;
4135+
kLocalOptimizationAdjustment = 1;
4136+
kGridOptimizationAdjustment = 2;
4137+
}
4138+
41334139
bitmap Feature : bitmap32 {
41344140
kPowerAdjustment = 0x1;
41354141
kPowerForecastReporting = 0x2;
@@ -4147,13 +4153,25 @@ provisional cluster DeviceEnergyManagement = 152 {
41474153
optional int16u currency = 3;
41484154
}
41494155

4156+
struct PowerAdjustStruct {
4157+
power_mw minPower = 0;
4158+
power_mw maxPower = 1;
4159+
elapsed_s minDuration = 2;
4160+
elapsed_s maxDuration = 3;
4161+
}
4162+
4163+
struct PowerAdjustCapabilityStruct {
4164+
nullable PowerAdjustStruct powerAdjustCapability[] = 0;
4165+
PowerAdjustReasonEnum cause = 1;
4166+
}
4167+
41504168
struct SlotStruct {
41514169
elapsed_s minDuration = 0;
41524170
elapsed_s maxDuration = 1;
41534171
elapsed_s defaultDuration = 2;
41544172
elapsed_s elapsedSlotTime = 3;
41554173
elapsed_s remainingSlotTime = 4;
4156-
optional boolean slotIsPauseable = 5;
4174+
optional boolean slotIsPausable = 5;
41574175
optional elapsed_s minPauseDuration = 6;
41584176
optional elapsed_s maxPauseDuration = 7;
41594177
optional int16u manufacturerESAState = 8;
@@ -4169,13 +4187,13 @@ provisional cluster DeviceEnergyManagement = 152 {
41694187
}
41704188

41714189
struct ForecastStruct {
4172-
int16u forecastId = 0;
4190+
int32u forecastID = 0;
41734191
nullable int16u activeSlotNumber = 1;
41744192
epoch_s startTime = 2;
41754193
epoch_s endTime = 3;
41764194
optional nullable epoch_s earliestStartTime = 4;
41774195
optional epoch_s latestEndTime = 5;
4178-
boolean isPauseable = 6;
4196+
boolean isPausable = 6;
41794197
SlotStruct slots[] = 7;
41804198
ForecastUpdateReasonEnum forecastUpdateReason = 8;
41814199
}
@@ -4188,16 +4206,9 @@ provisional cluster DeviceEnergyManagement = 152 {
41884206
optional int8s loadControl = 4;
41894207
}
41904208

4191-
struct PowerAdjustStruct {
4192-
power_mw minPower = 0;
4193-
power_mw maxPower = 1;
4194-
elapsed_s minDuration = 2;
4195-
elapsed_s maxDuration = 3;
4196-
}
4197-
41984209
struct SlotAdjustmentStruct {
41994210
int8u slotIndex = 0;
4200-
power_mw nominalPower = 1;
4211+
optional power_mw nominalPower = 1;
42014212
elapsed_s duration = 2;
42024213
}
42034214

@@ -4222,7 +4233,7 @@ provisional cluster DeviceEnergyManagement = 152 {
42224233
readonly attribute ESAStateEnum ESAState = 2;
42234234
readonly attribute power_mw absMinPower = 3;
42244235
readonly attribute power_mw absMaxPower = 4;
4225-
readonly attribute optional nullable PowerAdjustStruct powerAdjustmentCapability[] = 5;
4236+
readonly attribute optional nullable PowerAdjustCapabilityStruct powerAdjustmentCapability = 5;
42264237
readonly attribute optional nullable ForecastStruct forecast = 6;
42274238
readonly attribute optional OptOutStateEnum optOutState = 7;
42284239
readonly attribute command_id generatedCommandList[] = 65528;
@@ -4249,7 +4260,7 @@ provisional cluster DeviceEnergyManagement = 152 {
42494260
}
42504261

42514262
request struct ModifyForecastRequestRequest {
4252-
int32u forecastId = 0;
4263+
int32u forecastID = 0;
42534264
SlotAdjustmentStruct slotAdjustments[] = 1;
42544265
AdjustmentCauseEnum cause = 2;
42554266
}

‎examples/energy-management-app/energy-management-common/energy-management-app.matter

+25-14
Original file line numberDiff line numberDiff line change
@@ -1430,7 +1430,7 @@ cluster ElectricalEnergyMeasurement = 145 {
14301430

14311431
/** This cluster allows a client to manage the power draw of a device. An example of such a client could be an Energy Management System (EMS) which controls an Energy Smart Appliance (ESA). */
14321432
provisional cluster DeviceEnergyManagement = 152 {
1433-
revision 3;
1433+
revision 4;
14341434

14351435
enum AdjustmentCauseEnum : enum8 {
14361436
kLocalOptimization = 0;
@@ -1491,6 +1491,12 @@ provisional cluster DeviceEnergyManagement = 152 {
14911491
kOptOut = 3;
14921492
}
14931493

1494+
enum PowerAdjustReasonEnum : enum8 {
1495+
kNoAdjustment = 0;
1496+
kLocalOptimizationAdjustment = 1;
1497+
kGridOptimizationAdjustment = 2;
1498+
}
1499+
14941500
bitmap Feature : bitmap32 {
14951501
kPowerAdjustment = 0x1;
14961502
kPowerForecastReporting = 0x2;
@@ -1508,13 +1514,25 @@ provisional cluster DeviceEnergyManagement = 152 {
15081514
optional int16u currency = 3;
15091515
}
15101516

1517+
struct PowerAdjustStruct {
1518+
power_mw minPower = 0;
1519+
power_mw maxPower = 1;
1520+
elapsed_s minDuration = 2;
1521+
elapsed_s maxDuration = 3;
1522+
}
1523+
1524+
struct PowerAdjustCapabilityStruct {
1525+
nullable PowerAdjustStruct powerAdjustCapability[] = 0;
1526+
PowerAdjustReasonEnum cause = 1;
1527+
}
1528+
15111529
struct SlotStruct {
15121530
elapsed_s minDuration = 0;
15131531
elapsed_s maxDuration = 1;
15141532
elapsed_s defaultDuration = 2;
15151533
elapsed_s elapsedSlotTime = 3;
15161534
elapsed_s remainingSlotTime = 4;
1517-
optional boolean slotIsPauseable = 5;
1535+
optional boolean slotIsPausable = 5;
15181536
optional elapsed_s minPauseDuration = 6;
15191537
optional elapsed_s maxPauseDuration = 7;
15201538
optional int16u manufacturerESAState = 8;
@@ -1530,13 +1548,13 @@ provisional cluster DeviceEnergyManagement = 152 {
15301548
}
15311549

15321550
struct ForecastStruct {
1533-
int16u forecastId = 0;
1551+
int32u forecastID = 0;
15341552
nullable int16u activeSlotNumber = 1;
15351553
epoch_s startTime = 2;
15361554
epoch_s endTime = 3;
15371555
optional nullable epoch_s earliestStartTime = 4;
15381556
optional epoch_s latestEndTime = 5;
1539-
boolean isPauseable = 6;
1557+
boolean isPausable = 6;
15401558
SlotStruct slots[] = 7;
15411559
ForecastUpdateReasonEnum forecastUpdateReason = 8;
15421560
}
@@ -1549,16 +1567,9 @@ provisional cluster DeviceEnergyManagement = 152 {
15491567
optional int8s loadControl = 4;
15501568
}
15511569

1552-
struct PowerAdjustStruct {
1553-
power_mw minPower = 0;
1554-
power_mw maxPower = 1;
1555-
elapsed_s minDuration = 2;
1556-
elapsed_s maxDuration = 3;
1557-
}
1558-
15591570
struct SlotAdjustmentStruct {
15601571
int8u slotIndex = 0;
1561-
power_mw nominalPower = 1;
1572+
optional power_mw nominalPower = 1;
15621573
elapsed_s duration = 2;
15631574
}
15641575

@@ -1583,7 +1594,7 @@ provisional cluster DeviceEnergyManagement = 152 {
15831594
readonly attribute ESAStateEnum ESAState = 2;
15841595
readonly attribute power_mw absMinPower = 3;
15851596
readonly attribute power_mw absMaxPower = 4;
1586-
readonly attribute optional nullable PowerAdjustStruct powerAdjustmentCapability[] = 5;
1597+
readonly attribute optional nullable PowerAdjustCapabilityStruct powerAdjustmentCapability = 5;
15871598
readonly attribute optional nullable ForecastStruct forecast = 6;
15881599
readonly attribute optional OptOutStateEnum optOutState = 7;
15891600
readonly attribute command_id generatedCommandList[] = 65528;
@@ -1610,7 +1621,7 @@ provisional cluster DeviceEnergyManagement = 152 {
16101621
}
16111622

16121623
request struct ModifyForecastRequestRequest {
1613-
int32u forecastId = 0;
1624+
int32u forecastID = 0;
16141625
SlotAdjustmentStruct slotAdjustments[] = 1;
16151626
AdjustmentCauseEnum cause = 2;
16161627
}

0 commit comments

Comments
 (0)