Skip to content

Commit d63ef5c

Browse files
EVSE and Device Energy Management XML should use new base energy reporting types (and other minor fixes) (#30701)
* Fix #30665 (EVSE) - Changed to use amperage_mA, energy_mWh - removed max on epoch_s - removed access for operate - removed side for events * Fix #30665 updates to try to get further with ZAP and autogen, but still fails with some parts of regen_all * Added ember-compatibility-functions.cpp which was missing. * Made all types all lowercase to resolve regen_all issues. * Fixed lint issue (trailing whitespace). * Aligned EVSE XML to same state as PR#30857 (includes SessionID being Nullable etc and in Fault Event). * Updated Device Energy Management XML to use power_mw, energy_mwh per spec definition. * Updated controller-clusters.zap * regen_all.py * Restyled by whitespace * Fixed types to be signed=true * Fixed 31032 - revert removal of side="server". * regen_all.py * Change to cause restyled to re-run after failure. :( * Revert "Change to cause restyled to re-run after failure. :(" This reverts commit b515c33. --------- Co-authored-by: Restyled.io <commits@restyled.io>
1 parent 342e338 commit d63ef5c

File tree

4 files changed

+34
-34
lines changed

4 files changed

+34
-34
lines changed

src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml

+15-15
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ limitations under the License.
3838
<attribute code="0x0000" side="server" type="ESATypeEnum" define="ESA_TYPE" writable="false" optional="false">ESAType</attribute>
3939
<attribute code="0x0001" side="server" type="boolean" define="ESA_CAN_GENERATE" writable="false" optional="false">ESACanGenerate</attribute>
4040
<attribute code="0x0002" side="server" type="ESAStateEnum" define="ESA_STATE" default="0" writable="false" optional="false">ESAState</attribute>
41-
<attribute code="0x0003" side="server" type="int64s" define="ABS_MIN_POWER" default="0" writable="false" optional="false">AbsMinPower</attribute>
42-
<attribute code="0x0004" side="server" type="int64s" define="ABS_MAX_POWER" default="0" writable="false" optional="false">AbsMaxPower</attribute>
41+
<attribute code="0x0003" side="server" type="power_mw" define="ABS_MIN_POWER" default="0" writable="false" optional="false">AbsMinPower</attribute>
42+
<attribute code="0x0004" side="server" type="power_mw" define="ABS_MAX_POWER" default="0" writable="false" optional="false">AbsMaxPower</attribute>
4343
<!--Conformance feature PA - for now optional-->
4444
<attribute code="0x0005" side="server" type="ARRAY" entryType="PowerAdjustStruct" define="POWER_ADJUSTMENT_CAPABILITY" isNullable="true" writable="false" optional="true">PowerAdjustmentCapability</attribute>
4545
<!--Conformance feature PFR \| SFR - for now optional-->
4646
<attribute code="0x0006" side="server" type="ForecastStruct" define="FORECAST" isNullable="true" writable="false" optional="true">Forecast</attribute>
4747
<command source="client" code="0x0000" name="PowerAdjustRequest" optional="true" apiMaturity="provisional">
48-
<arg name="Power" type="int64s"/>
48+
<arg name="Power" type="power_mw"/>
4949
<arg name="Duration" type="elapsed_s"/>
5050
<description>Allows a client to request an adjustment in the power consumption of an ESA for a specified duration.</description>
5151
</command>
@@ -79,7 +79,7 @@ limitations under the License.
7979
<description>PowerAdjustEnd</description>
8080
<field id="0" name="Cause" type="CauseEnum" apiMaturity="provisional"/>
8181
<field id="1" name="Duration" type="elapsed_s" apiMaturity="provisional"/>
82-
<field id="2" name="EnergyUse" type="int64s" apiMaturity="provisional"/>
82+
<field id="2" name="EnergyUse" type="energy_mwh" apiMaturity="provisional"/>
8383
</event>
8484
<event code="0x0002" name="Paused" priority="info" side="server" apiMaturity="provisional" optional="true">
8585
<description>Paused</description>
@@ -138,8 +138,8 @@ limitations under the License.
138138
</struct>
139139
<struct name="PowerAdjustStruct" apiMaturity="provisional">
140140
<cluster code="0x0098"/>
141-
<item fieldId="0" name="MinPower" type="int64s"/>
142-
<item fieldId="1" name="MaxPower" type="int64s"/>
141+
<item fieldId="0" name="MinPower" type="power_mw"/>
142+
<item fieldId="1" name="MaxPower" type="power_mw"/>
143143
<item fieldId="2" name="MinDuration" type="elapsed_s"/>
144144
<item fieldId="3" name="MaxDuration" type="elapsed_s"/>
145145
</struct>
@@ -165,28 +165,28 @@ limitations under the License.
165165
<item fieldId="6" name="MinPauseDuration" type="elapsed_s"/>
166166
<item fieldId="7" name="MaxPauseDuration" type="elapsed_s"/>
167167
<item fieldId="8" name="ManufacturerESAState" type="int16u" optional="true"/>
168-
<item fieldId="9" name="NominalPower" type="int64s" optional="true"/>
169-
<item fieldId="10" name="MinPower" type="int64s" optional="true"/>
170-
<item fieldId="11" name="MaxPower" type="int64s" optional="true"/>
171-
<item fieldId="12" name="NominalEnergy" type="int64s" optional="true"/>
168+
<item fieldId="9" name="NominalPower" type="power_mw" optional="true"/>
169+
<item fieldId="10" name="MinPower" type="power_mw" optional="true"/>
170+
<item fieldId="11" name="MaxPower" type="power_mw" optional="true"/>
171+
<item fieldId="12" name="NominalEnergy" type="energy_mwh" optional="true"/>
172172
<item fieldId="13" name="Costs" array="true" type="CostStruct" optional="true"/>
173-
<item fieldId="14" name="MinPowerAdjustment" type="int64s" optional="true"/>
174-
<item fieldId="15" name="MaxPowerAdjustment" type="int64s" optional="true"/>
173+
<item fieldId="14" name="MinPowerAdjustment" type="power_mw" optional="true"/>
174+
<item fieldId="15" name="MaxPowerAdjustment" type="power_mw" optional="true"/>
175175
<item fieldId="16" name="MinDurationAdjustment" type="elapsed_s" optional="true"/>
176176
<item fieldId="17" name="MaxDurationAdjustment" type="elapsed_s" optional="true"/>
177177
</struct>
178178
<struct name="SlotAdjustmentStruct" apiMaturity="provisional">
179179
<cluster code="0x0098"/>
180180
<item fieldId="0" name="SlotIndex" type="int8u"/>
181-
<item fieldId="1" name="NominalPower" type="int64s"/>
181+
<item fieldId="1" name="NominalPower" type="power_mw"/>
182182
<item fieldId="2" name="Duration" type="elapsed_s"/>
183183
</struct>
184184
<struct name="ConstraintsStruct" apiMaturity="provisional">
185185
<cluster code="0x0098"/>
186186
<item fieldId="0" name="StartTime" type="epoch_s"/>
187187
<item fieldId="1" name="Duration" type="elapsed_s" min="0" max="86400"/>
188-
<item fieldId="2" name="NominalPower" type="int64s" optional="true"/>
189-
<item fieldId="3" name="MaximumEnergy" type="int64s" optional="true"/>
188+
<item fieldId="2" name="NominalPower" type="power_mw" optional="true"/>
189+
<item fieldId="3" name="MaximumEnergy" type="energy_mwh" optional="true"/>
190190
<item fieldId="4" name="LoadControl" type="int8s" optional="true"/>
191191
</struct>
192192
</configurator>

src/controller/data_model/controller-clusters.matter

+15-15
Original file line numberDiff line numberDiff line change
@@ -4451,13 +4451,13 @@ provisional cluster DeviceEnergyManagement = 152 {
44514451
elapsed_s minPauseDuration = 6;
44524452
elapsed_s maxPauseDuration = 7;
44534453
optional int16u manufacturerESAState = 8;
4454-
optional int64s nominalPower = 9;
4455-
optional int64s minPower = 10;
4456-
optional int64s maxPower = 11;
4457-
optional int64s nominalEnergy = 12;
4454+
optional power_mw nominalPower = 9;
4455+
optional power_mw minPower = 10;
4456+
optional power_mw maxPower = 11;
4457+
optional energy_mwh nominalEnergy = 12;
44584458
optional CostStruct costs[] = 13;
4459-
optional int64s minPowerAdjustment = 14;
4460-
optional int64s maxPowerAdjustment = 15;
4459+
optional power_mw minPowerAdjustment = 14;
4460+
optional power_mw maxPowerAdjustment = 15;
44614461
optional elapsed_s minDurationAdjustment = 16;
44624462
optional elapsed_s maxDurationAdjustment = 17;
44634463
}
@@ -4476,21 +4476,21 @@ provisional cluster DeviceEnergyManagement = 152 {
44764476
struct ConstraintsStruct {
44774477
epoch_s startTime = 0;
44784478
elapsed_s duration = 1;
4479-
optional int64s nominalPower = 2;
4480-
optional int64s maximumEnergy = 3;
4479+
optional power_mw nominalPower = 2;
4480+
optional energy_mwh maximumEnergy = 3;
44814481
optional int8s loadControl = 4;
44824482
}
44834483

44844484
struct PowerAdjustStruct {
4485-
int64s minPower = 0;
4486-
int64s maxPower = 1;
4485+
power_mw minPower = 0;
4486+
power_mw maxPower = 1;
44874487
elapsed_s minDuration = 2;
44884488
elapsed_s maxDuration = 3;
44894489
}
44904490

44914491
struct SlotAdjustmentStruct {
44924492
int8u slotIndex = 0;
4493-
int64s nominalPower = 1;
4493+
power_mw nominalPower = 1;
44944494
elapsed_s duration = 2;
44954495
}
44964496

@@ -4500,7 +4500,7 @@ provisional cluster DeviceEnergyManagement = 152 {
45004500
info event PowerAdjustEnd = 1 {
45014501
CauseEnum cause = 0;
45024502
elapsed_s duration = 1;
4503-
int64s energyUse = 2;
4503+
energy_mwh energyUse = 2;
45044504
}
45054505

45064506
info event Paused = 2 {
@@ -4512,8 +4512,8 @@ provisional cluster DeviceEnergyManagement = 152 {
45124512
readonly attribute ESATypeEnum ESAType = 0;
45134513
readonly attribute boolean ESACanGenerate = 1;
45144514
readonly attribute ESAStateEnum ESAState = 2;
4515-
readonly attribute int64s absMinPower = 3;
4516-
readonly attribute int64s absMaxPower = 4;
4515+
readonly attribute power_mw absMinPower = 3;
4516+
readonly attribute power_mw absMaxPower = 4;
45174517
readonly attribute optional nullable PowerAdjustStruct powerAdjustmentCapability[] = 5;
45184518
readonly attribute optional nullable ForecastStruct forecast = 6;
45194519
readonly attribute command_id generatedCommandList[] = 65528;
@@ -4524,7 +4524,7 @@ provisional cluster DeviceEnergyManagement = 152 {
45244524
readonly attribute int16u clusterRevision = 65533;
45254525

45264526
request struct PowerAdjustRequestRequest {
4527-
int64s power = 0;
4527+
power_mw power = 0;
45284528
elapsed_s duration = 1;
45294529
}
45304530

zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)