Skip to content

Commit

Permalink
Added XML for #30264 (Missing Device Energy Management cluster) (#30589)
Browse files Browse the repository at this point in the history
* Added XML for #30264 (Missing Device Energy Management cluster)

* Added clusterRevision =2 t XML
Added cluster to python CHIP-REPL clusters/__init__.py

* Restyled by isort

* Remerge __init__.py for CHIP-REPL

* Restyled by isort

* Resync'd to latest master and picked up revert change to DataModelLogger.cpp

---------

Co-authored-by: Restyled.io <commits@restyled.io>
  • Loading branch information
jamesharrow and restyled-commits authored Dec 6, 2023
1 parent 8c45ed8 commit 26b0bbf
Show file tree
Hide file tree
Showing 74 changed files with 14,587 additions and 19 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ jobs:
src/app/zap-templates/zcl/data-model/chip/content-app-observer-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/content-control-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/descriptor-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/diagnostic-logs-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/dishwasher-alarm-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-cluster.xml \
Expand Down
1 change: 1 addition & 0 deletions docs/clusters.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ Generally regenerate using one of:
| 128 | 0x80 | BooleanSensorConfiguration |
| 129 | 0x81 | ValveConfigurationAndControl |
| 150 | 0x96 | DemandResponseLoadControl |
| 152 | 0x98 | DeviceEnergyManagement |
| 153 | 0x99 | EnergyEvse |
| 257 | 0x101 | DoorLock |
| 258 | 0x102 | WindowCovering |
Expand Down
1 change: 1 addition & 0 deletions scripts/rules.matterlint
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/content-app-observer-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/content-control-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/descriptor-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/diagnostic-logs-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/dishwasher-alarm-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-cluster.xml";
Expand Down
1 change: 1 addition & 0 deletions src/app/zap-templates/zcl/data-model/all.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<xi:include href="chip/concentration-measurement-cluster.xml" />
<xi:include href="chip/content-launch-cluster.xml" />
<xi:include href="chip/descriptor-cluster.xml" />
<xi:include href="chip/device-energy-management-cluster.xml" />
<xi:include href="chip/diagnostic-logs-cluster.xml" />
<xi:include href="chip/dishwasher-alarm-cluster.xml" />
<xi:include href="chip/dishwasher-mode-cluster.xml" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
<?xml version="1.0"?>
<!--
Copyright (c) 2023 Project CHIP Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<configurator>
<domain name="Energy Management"/>
<bitmap name="Feature" type="bitmap32">
<cluster code="0x0098"/>
<field name="PowerAdjustment" mask="0x1"/>
<field name="PowerForecastReporting" mask="0x2"/>
<field name="StateForecastReporting" mask="0x4"/>
<field name="ForecastAdjustment" mask="0x8"/>
</bitmap>
<cluster apiMaturity="provisional">
<name>Device Energy Management</name>
<domain>Energy Management</domain>
<code>0x0098</code>
<define>DEVICE_ENERGY_MANAGEMENT_CLUSTER</define>
<client init="false" tick="false">true</client>
<server init="false" tick="false">true</server>
<description>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).</description>

<globalAttribute side="server" code="0xFFFD" value="2" />

<!--Attributes-->
<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>
<!--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="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>
<command source="client" code="0x0001" name="CancelPowerAdjustRequest" optional="true" apiMaturity="provisional">
<description>Allows a client to cancel an ongoing PowerAdjustmentRequest operation.</description>
</command>
<command source="client" code="0x0002" name="StartTimeAdjustRequest" optional="true" apiMaturity="provisional">
<arg name="RequestedStartTime" type="epoch_s"/>
<description>Allows a client to adjust the start time of a Forecast sequence that has not yet started operation (i.e. where the current Forecast StartTime is in the future).</description>
</command>
<command source="client" code="0x0003" name="PauseRequest" optional="true" apiMaturity="provisional">
<arg name="Duration" type="elapsed_s"/>
<description>Allows a client to temporarily pause an operation and reduce the ESAs energy demand.</description>
</command>
<command source="client" code="0x0004" name="ResumeRequest" optional="true" apiMaturity="provisional">
<description>Allows a client to cancel the PauseRequest command and enable earlier resumption of operation.</description>
</command>
<command source="client" code="0x0005" name="ModifyForecastRequest" optional="true" apiMaturity="provisional">
<arg name="ForecastId" type="int32u"/>
<arg name="SlotAdjustments" array="true" type="SlotAdjustmentStruct"/>
<description>Allows a client to modify a Forecast within the limits allowed by the ESA.</description>
</command>
<command source="client" code="0x0006" name="RequestConstraintBasedForecast" optional="true" apiMaturity="provisional">
<arg name="Constraints" array="true" type="ConstraintsStruct"/>
<description>Allows a client to ask the ESA to recompute its Forecast based on power and time constraints.</description>
</command>
<event code="0x0000" name="PowerAdjustStart" priority="info" side="server" apiMaturity="provisional" optional="true">
<description>PowerAdjustStart</description>
</event>
<event code="0x0001" name="PowerAdjustEnd" priority="info" side="server" apiMaturity="provisional" optional="true">
<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"/>
</event>
<event code="0x0002" name="Paused" priority="info" side="server" apiMaturity="provisional" optional="true">
<description>Paused</description>
</event>
<event code="0x0003" name="Resumed" priority="info" side="server" apiMaturity="provisional" optional="true">
<description>Resumed</description>
</event>
</cluster>
<enum name="CostTypeEnum" type="enum8" apiMaturity="provisional">
<cluster code="0x0098"/>
<item name="Financial" value="0x00"/>
<item name="GHGEmissions" value="0x01"/>
<item name="Comfort" value="0x02"/>
<item name="Temperature" value="0x03"/>
</enum>
<enum name="ESATypeEnum" type="enum8" apiMaturity="provisional">
<cluster code="0x0098"/>
<item name="EVSE" value="0x00"/>
<item name="SpaceHeating" value="0x01"/>
<item name="WaterHeating" value="0x02"/>
<item name="SpaceCooling" value="0x03"/>
<item name="SpaceHeatingCooling" value="0x04"/>
<item name="BatteryStorage" value="0x05"/>
<item name="SolarPV" value="0x06"/>
<item name="FridgeFreezer" value="0x07"/>
<item name="WashingMachine" value="0x08"/>
<item name="Dishwasher" value="0x09"/>
<item name="Cooking" value="0x0A"/>
<item name="HomeWaterPump" value="0x0B"/>
<item name="IrrigationWaterPump" value="0x0C"/>
<item name="PoolPump" value="0x0D"/>
<item name="Other" value="0xFF"/>
</enum>
<enum name="ESAStateEnum" type="enum8" apiMaturity="provisional">
<cluster code="0x0098"/>
<item name="Offline" value="0x00"/>
<item name="Online" value="0x01"/>
<item name="Fault" value="0x02"/>
<item name="UserOptOut" value="0x03"/>
<item name="PowerAdjustActive" value="0x04"/>
<item name="Paused" value="0x05"/>
</enum>
<enum name="CauseEnum" type="enum8" apiMaturity="provisional">
<cluster code="0x0098"/>
<item name="NormalCompletion" value="0x00"/>
<item name="Offline" value="0x01"/>
<item name="Fault" value="0x02"/>
<item name="UserOptOut" value="0x03"/>
</enum>
<struct name="CostStruct" apiMaturity="provisional">
<cluster code="0x0098"/>
<item fieldId="0" name="CostType" type="CostTypeEnum"/>
<item fieldId="1" name="Value" type="int32s"/>
<item fieldId="2" name="DecimalPoints" type="int8u"/>
<item fieldId="3" name="Currency" type="int16u" max="999" optional="true"/>
</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="2" name="MinDuration" type="elapsed_s"/>
<item fieldId="3" name="MaxDuration" type="elapsed_s"/>
</struct>
<struct name="ForecastStruct" apiMaturity="provisional">
<cluster code="0x0098"/>
<item fieldId="0" name="ForecastId" type="int16u"/>
<item fieldId="1" name="ActiveSlotNumber" type="int16u" max="0xFFFE" isNullable="true"/>
<item fieldId="2" name="StartTime" type="epoch_s"/>
<item fieldId="3" name="EndTime" type="epoch_s"/>
<item fieldId="4" name="EarliestStartTime" type="epoch_s" max="0xFFFFFFFE" isNullable="true" optional="true"/>
<item fieldId="5" name="LatestEndTime" type="epoch_s" optional="true"/>
<item fieldId="6" name="IsPauseable" type="boolean"/>
<item fieldId="7" name="Slots" array="true" type="SlotStruct"/>
</struct>
<struct name="SlotStruct" apiMaturity="provisional">
<cluster code="0x0098"/>
<item fieldId="0" name="MinDuration" type="elapsed_s"/>
<item fieldId="1" name="MaxDuration" type="elapsed_s"/>
<item fieldId="2" name="DefaultDuration" type="elapsed_s"/>
<item fieldId="3" name="ElapsedSlotTime" type="elapsed_s"/>
<item fieldId="4" name="RemainingSlotTime" type="elapsed_s"/>
<item fieldId="5" name="SlotIsPauseable" type="boolean"/>
<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="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="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="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="4" name="LoadControl" type="int8s" optional="true"/>
</struct>
</configurator>
2 changes: 2 additions & 0 deletions src/app/zap-templates/zcl/zcl-with-test-extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"content-app-observer-cluster.xml",
"content-control-cluster.xml",
"descriptor-cluster.xml",
"device-energy-management-cluster.xml",
"diagnostic-logs-cluster.xml",
"dishwasher-alarm-cluster.xml",
"dishwasher-mode-cluster.xml",
Expand Down Expand Up @@ -175,6 +176,7 @@
],
"Bridged Device Basic Information": ["ProductAppearance"],
"Descriptor": ["ClusterRevision"],
"Device Energy Management": ["Forecast"],
"Ethernet Network Diagnostics": [
"PHYRate",
"FullDuplex",
Expand Down
2 changes: 2 additions & 0 deletions src/app/zap-templates/zcl/zcl.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"content-app-observer-cluster.xml",
"content-control-cluster.xml",
"descriptor-cluster.xml",
"device-energy-management-cluster.xml",
"diagnostic-logs-cluster.xml",
"dishwasher-alarm-cluster.xml",
"dishwasher-mode-cluster.xml",
Expand Down Expand Up @@ -173,6 +174,7 @@
],
"Bridged Device Basic Information": ["ProductAppearance"],
"Descriptor": ["ClusterRevision"],
"Device Energy Management": ["Forecast"],
"Ethernet Network Diagnostics": [
"PHYRate",
"FullDuplex",
Expand Down
2 changes: 2 additions & 0 deletions src/app/zap_cluster_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"CONTENT_CONTROL_CLUSTER": [],
"CONTENT_APP_OBSERVER_CLUSTER": [],
"DESCRIPTOR_CLUSTER": [],
"DEVICE_ENERGY_MANAGEMENT_CLUSTER": [],
"DEVICE_TEMP_CLUSTER": [],
"DIAGNOSTIC_LOGS_CLUSTER": [],
"DISHWASHER_ALARM_CLUSTER": [],
Expand Down Expand Up @@ -162,6 +163,7 @@
"CONTENT_CONTROL_CLUSTER": ["content-control-server"],
"CONTENT_APP_OBSERVER_CLUSTER": ["content-app-observer"],
"DESCRIPTOR_CLUSTER": ["descriptor"],
"DEVICE_ENERGY_MANAGEMENT_CLUSTER": ["device-energy-management-server"],
"DEVICE_TEMP_CLUSTER": [],
"DIAGNOSTIC_LOGS_CLUSTER": ["diagnostic-logs-server"],
"DISHWASHER_ALARM_CLUSTER": ["dishwasher-alarm-server"],
Expand Down
2 changes: 2 additions & 0 deletions src/controller/data_model/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ if (current_os == "android" || matter_enable_java_compilation) {
"jni/DoorLockClient-ReadImpl.cpp",
"jni/ElectricalMeasurementClient-InvokeSubscribeImpl.cpp",
"jni/ElectricalMeasurementClient-ReadImpl.cpp",
"jni/DeviceEnergyManagementClient-InvokeSubscribeImpl.cpp",
"jni/DeviceEnergyManagementClient-ReadImpl.cpp",
"jni/EthernetNetworkDiagnosticsClient-InvokeSubscribeImpl.cpp",
"jni/EthernetNetworkDiagnosticsClient-ReadImpl.cpp",
"jni/EnergyEvseClient-InvokeSubscribeImpl.cpp",
Expand Down
Loading

0 comments on commit 26b0bbf

Please sign in to comment.