Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EVSE and Device Energy Management XML should use new base energy reporting types (and other minor fixes) #30701

Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
874d750
Fix #30665 (EVSE)
jamesharrow Nov 29, 2023
35a06a7
Fix #30665 updates to try to get further with ZAP and autogen, but st…
jamesharrow Nov 29, 2023
c3aef3a
Added ember-compatibility-functions.cpp which was missing.
jamesharrow Nov 29, 2023
a71bef8
Made all types all lowercase to resolve regen_all issues.
jamesharrow Nov 29, 2023
41acd01
Fixed lint issue (trailing whitespace).
jamesharrow Nov 29, 2023
1541c71
Merge branch 'upstream-master' into 30665-13-updates-needed-on-evse-x…
jamesharrow Dec 6, 2023
6b83a69
Merge branch 'upstream-master' into 30665-13-updates-needed-on-evse-x…
jamesharrow Dec 15, 2023
b44b866
Aligned EVSE XML to same state as PR#30857 (includes SessionID being …
jamesharrow Dec 15, 2023
42b79f0
Updated Device Energy Management XML to use power_mw, energy_mwh per …
jamesharrow Dec 15, 2023
56e62ec
Updated controller-clusters.zap
jamesharrow Dec 15, 2023
1b9316d
regen_all.py
jamesharrow Dec 15, 2023
460ca15
Restyled by whitespace
restyled-commits Dec 15, 2023
1e7fe6b
Merge branch 'master' into 30665-13-updates-needed-on-evse-xml-device…
jamesharrow Dec 15, 2023
3047c5a
Fixed types to be signed=true
jamesharrow Dec 16, 2023
e10f2cc
Fixed 31032 - revert removal of side="server".
jamesharrow Dec 16, 2023
711851c
regen_all.py
jamesharrow Dec 16, 2023
3dc98b0
Merge branch 'upstream-master' into 30665-13-updates-needed-on-evse-x…
jamesharrow Dec 18, 2023
b515c33
Change to cause restyled to re-run after failure. :(
jamesharrow Dec 18, 2023
b916654
Revert "Change to cause restyled to re-run after failure. :("
jamesharrow Dec 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ def is_struct(self) -> bool:
# Derived types
# Specification describes them in section '7.19.2. Derived Data Types'
"action_id": BasicInteger(idl_name="action_id", byte_count=1, is_signed=False),
"amperage_ma": BasicInteger(idl_name="amperage_ma", byte_count=8, is_signed=True),
"attrib_id": BasicInteger(idl_name="attrib_id", byte_count=4, is_signed=False),
"cluster_id": BasicInteger(idl_name="cluster_id", byte_count=4, is_signed=False),
"command_id": BasicInteger(idl_name="command_id", byte_count=4, is_signed=False),
Expand All @@ -196,6 +197,7 @@ def is_struct(self) -> bool:
"devtype_id": BasicInteger(idl_name="devtype_id", byte_count=4, is_signed=False),
"elapsed_s": BasicInteger(idl_name="elapsed_s", byte_count=4, is_signed=False),
"endpoint_no": BasicInteger(idl_name="endpoint_no", byte_count=2, is_signed=False),
"energy_mwh": BasicInteger(idl_name="energy_mwh", byte_count=8, is_signed=True),
"entry_idx": BasicInteger(idl_name="entry_idx", byte_count=2, is_signed=False),
"epoch_s": BasicInteger(idl_name="epoch_s", byte_count=4, is_signed=False),
"epoch_us": BasicInteger(idl_name="epoch_us", byte_count=8, is_signed=False),
Expand All @@ -210,6 +212,7 @@ def is_struct(self) -> bool:
"percent": BasicInteger(idl_name="percent", byte_count=1, is_signed=False),
"percent100ths": BasicInteger(idl_name="percent100ths", byte_count=2, is_signed=False),
"posix_ms": BasicInteger(idl_name="posix_ms", byte_count=8, is_signed=False),
"power_mw": BasicInteger(idl_name="power_mw", byte_count=8, is_signed=True),
"priority": BasicInteger(idl_name="priority", byte_count=1, is_signed=False),
"semtag": BasicInteger(idl_name="semtag", byte_count=4, is_signed=False),
"status": BasicInteger(idl_name="status", byte_count=1, is_signed=False),
Expand All @@ -220,6 +223,7 @@ def is_struct(self) -> bool:
"tod": BasicInteger(idl_name="tod", byte_count=4, is_signed=False),
"trans_id": BasicInteger(idl_name="trans_id", byte_count=4, is_signed=False),
"vendor_id": BasicInteger(idl_name="vendor_id", byte_count=2, is_signed=False),
"voltage_mv": BasicInteger(idl_name="voltage_mv", byte_count=8, is_signed=True),
}


Expand Down
6 changes: 6 additions & 0 deletions src/app/util/ember-compatibility-functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ EmberAfAttributeType BaseType(EmberAfAttributeType type)
"chip::DataVersion is expected to be uint32_t, change this when necessary");
return ZCL_INT32U_ATTRIBUTE_TYPE;

case ZCL_AMPERAGE_MA_ATTRIBUTE_TYPE: // Amperage milliamps
case ZCL_ENERGY_MWH_ATTRIBUTE_TYPE: // Energy milliwatt-hours
case ZCL_POWER_MW_ATTRIBUTE_TYPE: // Power milliwatts
case ZCL_VOLTAGE_MV_ATTRIBUTE_TYPE: // Voltage millivolts
return ZCL_INT64S_ATTRIBUTE_TYPE;

case ZCL_EVENT_NO_ATTRIBUTE_TYPE: // Event Number
case ZCL_FABRIC_ID_ATTRIBUTE_TYPE: // Fabric Id
case ZCL_NODE_ID_ATTRIBUTE_TYPE: // Node Id
Expand Down
5 changes: 5 additions & 0 deletions src/app/zap-templates/common/override.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ function atomicType(arg)
return 'chip::Percent';
case 'percent100ths':
return 'chip::Percent100ths';
case 'power_mw':
case 'amperage_ma':
case 'voltage_mv':
case 'energy_mwh':
return 'int64_t';
case 'epoch_us':
case 'systime_us':
case 'posix_ms':
Expand Down
5 changes: 5 additions & 0 deletions src/app/zap-templates/zcl/data-model/chip/chip-types.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ limitations under the License.
<type id="0x42" description="Character String" name="char_string" composite="true"/>
<type id="0x44" description="Long Character String" name="long_char_string" composite="true"/>

<type id="0xD9" description="Power milliwatts" name="power_mw" size="8" analog="true" />
<type id="0xDA" description="Amperage milliamps" name="amperage_ma" size="8" analog="true" />
<type id="0xDB" description="Voltage millivolts" name="voltage_mv" size="8" analog="true" />
<type id="0xDC" description="Energy milliwatt-hours" name="energy_mwh" size="8" analog="true" />

<type id="0xE6" description="Percentage units 1%" name="percent" size="1" analog="true" />
<type id="0xE7" description="Percentage units 0.01%" name="percent100ths" size="2" analog="true" />

Expand Down
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>
Loading