Skip to content

Commit

Permalink
EVSE and Device Energy Management XML should use new base energy repo…
Browse files Browse the repository at this point in the history
…rting 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>
  • Loading branch information
2 people authored and pull[bot] committed Dec 22, 2023
1 parent 90b3c1c commit 3686388
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ limitations under the License.
<attribute code="0x0000" side="server" type="ESATypeEnum" define="ESA_TYPE" writable="false" optional="false">ESAType</attribute>
<attribute code="0x0001" side="server" type="boolean" define="ESA_CAN_GENERATE" writable="false" optional="false">ESACanGenerate</attribute>
<attribute code="0x0002" side="server" type="ESAStateEnum" define="ESA_STATE" default="0" writable="false" optional="false">ESAState</attribute>
<attribute code="0x0003" side="server" type="int64s" define="ABS_MIN_POWER" default="0" writable="false" optional="false">AbsMinPower</attribute>
<attribute code="0x0004" side="server" type="int64s" define="ABS_MAX_POWER" default="0" writable="false" optional="false">AbsMaxPower</attribute>
<attribute code="0x0003" side="server" type="power_mw" define="ABS_MIN_POWER" default="0" writable="false" optional="false">AbsMinPower</attribute>
<attribute code="0x0004" side="server" type="power_mw" define="ABS_MAX_POWER" default="0" writable="false" optional="false">AbsMaxPower</attribute>
<!--Conformance feature PA - for now optional-->
<attribute code="0x0005" side="server" type="ARRAY" entryType="PowerAdjustStruct" define="POWER_ADJUSTMENT_CAPABILITY" isNullable="true" writable="false" optional="true">PowerAdjustmentCapability</attribute>
<!--Conformance feature PFR \| SFR - for now optional-->
<attribute code="0x0006" side="server" type="ForecastStruct" define="FORECAST" isNullable="true" writable="false" optional="true">Forecast</attribute>
<command source="client" code="0x0000" name="PowerAdjustRequest" optional="true" apiMaturity="provisional">
<arg name="Power" type="int64s"/>
<arg name="Power" type="power_mw"/>
<arg name="Duration" type="elapsed_s"/>
<description>Allows a client to request an adjustment in the power consumption of an ESA for a specified duration.</description>
</command>
Expand Down Expand Up @@ -79,7 +79,7 @@ limitations under the License.
<description>PowerAdjustEnd</description>
<field id="0" name="Cause" type="CauseEnum" apiMaturity="provisional"/>
<field id="1" name="Duration" type="elapsed_s" apiMaturity="provisional"/>
<field id="2" name="EnergyUse" type="int64s" apiMaturity="provisional"/>
<field id="2" name="EnergyUse" type="energy_mwh" apiMaturity="provisional"/>
</event>
<event code="0x0002" name="Paused" priority="info" side="server" apiMaturity="provisional" optional="true">
<description>Paused</description>
Expand Down Expand Up @@ -138,8 +138,8 @@ limitations under the License.
</struct>
<struct name="PowerAdjustStruct" apiMaturity="provisional">
<cluster code="0x0098"/>
<item fieldId="0" name="MinPower" type="int64s"/>
<item fieldId="1" name="MaxPower" type="int64s"/>
<item fieldId="0" name="MinPower" type="power_mw"/>
<item fieldId="1" name="MaxPower" type="power_mw"/>
<item fieldId="2" name="MinDuration" type="elapsed_s"/>
<item fieldId="3" name="MaxDuration" type="elapsed_s"/>
</struct>
Expand All @@ -165,28 +165,28 @@ limitations under the License.
<item fieldId="6" name="MinPauseDuration" type="elapsed_s"/>
<item fieldId="7" name="MaxPauseDuration" type="elapsed_s"/>
<item fieldId="8" name="ManufacturerESAState" type="int16u" optional="true"/>
<item fieldId="9" name="NominalPower" type="int64s" optional="true"/>
<item fieldId="10" name="MinPower" type="int64s" optional="true"/>
<item fieldId="11" name="MaxPower" type="int64s" optional="true"/>
<item fieldId="12" name="NominalEnergy" type="int64s" optional="true"/>
<item fieldId="9" name="NominalPower" type="power_mw" optional="true"/>
<item fieldId="10" name="MinPower" type="power_mw" optional="true"/>
<item fieldId="11" name="MaxPower" type="power_mw" optional="true"/>
<item fieldId="12" name="NominalEnergy" type="energy_mwh" optional="true"/>
<item fieldId="13" name="Costs" array="true" type="CostStruct" optional="true"/>
<item fieldId="14" name="MinPowerAdjustment" type="int64s" optional="true"/>
<item fieldId="15" name="MaxPowerAdjustment" type="int64s" optional="true"/>
<item fieldId="14" name="MinPowerAdjustment" type="power_mw" optional="true"/>
<item fieldId="15" name="MaxPowerAdjustment" type="power_mw" optional="true"/>
<item fieldId="16" name="MinDurationAdjustment" type="elapsed_s" optional="true"/>
<item fieldId="17" name="MaxDurationAdjustment" type="elapsed_s" optional="true"/>
</struct>
<struct name="SlotAdjustmentStruct" apiMaturity="provisional">
<cluster code="0x0098"/>
<item fieldId="0" name="SlotIndex" type="int8u"/>
<item fieldId="1" name="NominalPower" type="int64s"/>
<item fieldId="1" name="NominalPower" type="power_mw"/>
<item fieldId="2" name="Duration" type="elapsed_s"/>
</struct>
<struct name="ConstraintsStruct" apiMaturity="provisional">
<cluster code="0x0098"/>
<item fieldId="0" name="StartTime" type="epoch_s"/>
<item fieldId="1" name="Duration" type="elapsed_s" min="0" max="86400"/>
<item fieldId="2" name="NominalPower" type="int64s" optional="true"/>
<item fieldId="3" name="MaximumEnergy" type="int64s" optional="true"/>
<item fieldId="2" name="NominalPower" type="power_mw" optional="true"/>
<item fieldId="3" name="MaximumEnergy" type="energy_mwh" optional="true"/>
<item fieldId="4" name="LoadControl" type="int8s" optional="true"/>
</struct>
</configurator>
30 changes: 15 additions & 15 deletions src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -4451,13 +4451,13 @@ provisional cluster DeviceEnergyManagement = 152 {
elapsed_s minPauseDuration = 6;
elapsed_s maxPauseDuration = 7;
optional int16u manufacturerESAState = 8;
optional int64s nominalPower = 9;
optional int64s minPower = 10;
optional int64s maxPower = 11;
optional int64s nominalEnergy = 12;
optional power_mw nominalPower = 9;
optional power_mw minPower = 10;
optional power_mw maxPower = 11;
optional energy_mwh nominalEnergy = 12;
optional CostStruct costs[] = 13;
optional int64s minPowerAdjustment = 14;
optional int64s maxPowerAdjustment = 15;
optional power_mw minPowerAdjustment = 14;
optional power_mw maxPowerAdjustment = 15;
optional elapsed_s minDurationAdjustment = 16;
optional elapsed_s maxDurationAdjustment = 17;
}
Expand All @@ -4476,21 +4476,21 @@ provisional cluster DeviceEnergyManagement = 152 {
struct ConstraintsStruct {
epoch_s startTime = 0;
elapsed_s duration = 1;
optional int64s nominalPower = 2;
optional int64s maximumEnergy = 3;
optional power_mw nominalPower = 2;
optional energy_mwh maximumEnergy = 3;
optional int8s loadControl = 4;
}

struct PowerAdjustStruct {
int64s minPower = 0;
int64s maxPower = 1;
power_mw minPower = 0;
power_mw maxPower = 1;
elapsed_s minDuration = 2;
elapsed_s maxDuration = 3;
}

struct SlotAdjustmentStruct {
int8u slotIndex = 0;
int64s nominalPower = 1;
power_mw nominalPower = 1;
elapsed_s duration = 2;
}

Expand All @@ -4500,7 +4500,7 @@ provisional cluster DeviceEnergyManagement = 152 {
info event PowerAdjustEnd = 1 {
CauseEnum cause = 0;
elapsed_s duration = 1;
int64s energyUse = 2;
energy_mwh energyUse = 2;
}

info event Paused = 2 {
Expand All @@ -4512,8 +4512,8 @@ provisional cluster DeviceEnergyManagement = 152 {
readonly attribute ESATypeEnum ESAType = 0;
readonly attribute boolean ESACanGenerate = 1;
readonly attribute ESAStateEnum ESAState = 2;
readonly attribute int64s absMinPower = 3;
readonly attribute int64s absMaxPower = 4;
readonly attribute power_mw absMinPower = 3;
readonly attribute power_mw absMaxPower = 4;
readonly attribute optional nullable PowerAdjustStruct powerAdjustmentCapability[] = 5;
readonly attribute optional nullable ForecastStruct forecast = 6;
readonly attribute command_id generatedCommandList[] = 65528;
Expand All @@ -4524,7 +4524,7 @@ provisional cluster DeviceEnergyManagement = 152 {
readonly attribute int16u clusterRevision = 65533;

request struct PowerAdjustRequestRequest {
int64s power = 0;
power_mw power = 0;
elapsed_s duration = 1;
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3686388

Please sign in to comment.