Skip to content

Commit

Permalink
Add device-energy-management cluster example app code for 1.4 (#33910)
Browse files Browse the repository at this point in the history
* Get the EVSE app building and test TC_DEM_2_2 passing

* Get all targets building

* Address JamesH review comments

* Rename utils.cpp to DEMUtils.cpp

* Address JamesH review comments

* Restyled by whitespace

* Restyled by clang-format

* Restyled by gn

* Restyled by prettier-markdown

* Restyled by autopep8

* Restyled by isort

* Fix compilation problem by including lib/core/DataModelTypes.h

* Fix compilation problem by including

* Save examples/all-clusters-app/all-clusters-common/all-clusters-app.zap to update it

* Restyled by clang-format

* Apply further code review changes

* Restyled by clang-format

* Restyled by gn

* Address code review comments from AndreiL

* Restyled by whitespace

* Restyled by clang-format

* Fix ESP build

* Fix ESP build

* Restyled by clang-format

* Rename src/python_testing/TC_DEM_Utils.py src/python_testing/DEMTestBase.py

* Put time util funtions into namespace + drop the Utils prefix

* Restyled by whitespace

* Restyled by isort

* Try to address setForecast comments from Boris

* Remove unnecessary SetXXX methods from the device energy management cluster interface

* Restyled by clang-format

* Apply code review changes suggested by Louis-Philip Beliveau

* Document the API for GetForecast and GetPowerAdjustmentCapability

* Document the GetForecast and GetPowerAdjustmentCapability APIs

* Update src/app/clusters/device-energy-management-server/device-energy-management-server.h

Co-authored-by: Boris Zbarsky <[email protected]>

* Update src/app/clusters/device-energy-management-server/device-energy-management-server.h

Co-authored-by: Boris Zbarsky <[email protected]>

* Address review comments from Boris

* Sync up with code review comments from PR34234

* Sync up with code review comments from PR34234 that caused some return codes to change

* Restyled by clang-format

* modifyForecastRequest: Failure should be returned if a slot number > num slots in a forecast

* Update examples/energy-management-app/energy-management-common/include/DeviceEnergyManagementDelegateImpl.h

Co-authored-by: Boris Zbarsky <[email protected]>

* Update examples/energy-management-app/energy-management-common/include/DeviceEnergyManagementManager.h

Co-authored-by: Boris Zbarsky <[email protected]>

* Update examples/energy-management-app/energy-management-common/include/EVSECallbacks.h

Co-authored-by: Boris Zbarsky <[email protected]>

* Update examples/energy-management-app/energy-management-common/include/EVSEManufacturerImpl.h

Co-authored-by: Boris Zbarsky <[email protected]>

* Update examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h

Co-authored-by: Boris Zbarsky <[email protected]>

* Update examples/energy-management-app/energy-management-common/src/DEMTestEventTriggers.cpp

Co-authored-by: Boris Zbarsky <[email protected]>

* Update examples/energy-management-app/energy-management-common/include/EnergyEvseManager.h

Co-authored-by: Boris Zbarsky <[email protected]>

* Update examples/energy-management-app/energy-management-common/src/DEMTestEventTriggers.cpp

Co-authored-by: Boris Zbarsky <[email protected]>

* Update examples/energy-management-app/energy-management-common/src/DEMTestEventTriggers.cpp

Co-authored-by: Boris Zbarsky <[email protected]>

* Address review comments from Boris

* Update examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp

Co-authored-by: Boris Zbarsky <[email protected]>

* Address further review comments from Boris

* Address further review comments from Boris

* Address further review comments from Boris

* Update examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp

Co-authored-by: Boris Zbarsky <[email protected]>

* Address further review comments from Boris

* Update examples/energy-management-app/energy-management-common/src/DEMTestEventTriggers.cpp

Co-authored-by: Boris Zbarsky <[email protected]>

* Update examples/energy-management-app/energy-management-common/src/EnergyTimeUtils.cpp

Co-authored-by: Boris Zbarsky <[email protected]>

* Update examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp

Co-authored-by: Boris Zbarsky <[email protected]>

* Update examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp

Co-authored-by: Boris Zbarsky <[email protected]>

* Apply further review comments from Boris

* Used a bitmap rather than uint8_t and sync EnergyTimeUtils files from the EVSE_Add_Get_Set_Clear_Targets_Support branch

* Update following review comments from Boris

* Allow more time for forecast.startTime in test setup as tests can take variable lengths of time to run

* Update examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp

Co-authored-by: Boris Zbarsky <[email protected]>

* Update examples/energy-management-app/energy-management-common/src/EnergyTimeUtils.cpp

Co-authored-by: Boris Zbarsky <[email protected]>

* Update examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp

Co-authored-by: Boris Zbarsky <[email protected]>

* Addressing further review comments from Boris

* Fix small issue found as a result of the DEM test script review

* Protect against forecast being null

* Remove src/python_testing/DEMTestBase.py as renamed in PR34234

* Update following review comment from Andrei

* Restyled by clang-format

---------

Co-authored-by: Restyled.io <[email protected]>
Co-authored-by: Boris Zbarsky <[email protected]>
  • Loading branch information
3 people authored and pull[bot] committed Aug 21, 2024
1 parent bd2aef0 commit 1092309
Show file tree
Hide file tree
Showing 49 changed files with 3,002 additions and 504 deletions.
2 changes: 2 additions & 0 deletions examples/all-clusters-app/ameba/chip_main.cmake
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,10 @@ list(

${chip_dir}/examples/microwave-oven-app/microwave-oven-common/src/microwave-oven-device.cpp

${chip_dir}/examples/energy-management-app/energy-management-common/src/EnergyTimeUtils.cpp
${chip_dir}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp
${chip_dir}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp
${chip_dir}/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp
${chip_dir}/examples/energy-management-app/energy-management-common/src/ElectricalPowerMeasurementDelegate.cpp
${chip_dir}/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp
${chip_dir}/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp
Expand Down
2 changes: 2 additions & 0 deletions examples/all-clusters-app/asr/BUILD.gn
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ asr_executable("clusters_app") {
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/ElectricalPowerMeasurementDelegate.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyTimeUtils.cpp",
"${examples_plat_dir}/ButtonHandler.cpp",
"${examples_plat_dir}/CHIPDeviceManager.cpp",
"${examples_plat_dir}/LEDWidget.cpp",
Expand Down
2 changes: 2 additions & 0 deletions examples/all-clusters-app/cc13x4_26x4/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,11 @@ ti_simplelink_executable("all-clusters-app") {
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/ElectricalPowerMeasurementDelegate.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyTimeUtils.cpp",
"${chip_root}/examples/providers/DeviceInfoProviderImpl.cpp",
"${chip_root}/src/app/clusters/general-diagnostics-server/GenericFaultTestEventTriggerHandler.cpp",
"${project_dir}/main/AppTask.cpp",
Expand Down
2 changes: 2 additions & 0 deletions examples/all-clusters-app/infineon/psoc6/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,11 @@ psoc6_executable("clusters_app") {
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/ElectricalPowerMeasurementDelegate.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyTimeUtils.cpp",
"${examples_plat_dir}/LEDWidget.cpp",
"${examples_plat_dir}/init_psoc6Platform.cpp",
"src/AppTask.cpp",
Expand Down
2 changes: 2 additions & 0 deletions examples/all-clusters-app/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,11 @@ source_set("chip-all-clusters-common") {
"${chip_root}/examples/all-clusters-app/linux/diagnostic-logs-provider-delegate-impl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/ElectricalPowerMeasurementDelegate.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyTimeUtils.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/device-energy-management-mode.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/energy-evse-mode.cpp",
"AllClustersCommandDelegate.cpp",
Expand Down
7 changes: 4 additions & 3 deletions examples/all-clusters-app/mbed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,13 @@ target_sources(${APP_TARGET} PRIVATE
${ALL_CLUSTERS_COMMON}/src/smco-stub.cpp
${ALL_CLUSTERS_COMMON}/src/static-supported-modes-manager.cpp
${ALL_CLUSTERS_COMMON}/src/static-supported-temperature-levels.cpp
${ENERGY_MANAGEMENT_COMMON}/src/EnergyTimeUtils.cpp
${ENERGY_MANAGEMENT_COMMON}/src/DeviceEnergyManagementDelegateImpl.cpp
${ENERGY_MANAGEMENT_COMMON}/src/DeviceEnergyManagementManager.cpp
${ENERGY_MANAGEMENT_COMMON}/src/EVSEManufacturerImpl.cpp
${ENERGY_MANAGEMENT_COMMON}/src/ElectricalPowerMeasurementDelegate.cpp
${ENERGY_MANAGEMENT_COMMON}/src/EnergyEvseDelegateImpl.cpp
${ENERGY_MANAGEMENT_COMMON}/src/EnergyEvseManager.cpp
${ENERGY_MANAGEMENT_COMMON}/src/DeviceEnergyManagementDelegateImpl.cpp
${ENERGY_MANAGEMENT_COMMON}/src/DeviceEnergyManagementManager.cpp

)

chip_configure_data_model(${APP_TARGET}
Expand Down
6 changes: 4 additions & 2 deletions examples/all-clusters-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ include(${CHIP_ROOT}/src/app/chip_data_model.cmake)
target_include_directories(app PRIVATE
main/include
${ALL_CLUSTERS_COMMON_DIR}/include
${ENERGY_MANAGEMENT_COMMON_DIR}/include
${ENERGY_MANAGEMENT_COMMON_DIR}/include
${GEN_DIR}/app-common
${GEN_DIR}/all-clusters-app
${NRFCONNECT_COMMON}/util/include)
Expand All @@ -57,13 +57,15 @@ target_sources(app PRIVATE
${ALL_CLUSTERS_COMMON_DIR}/src/fan-stub.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/oven-modes.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/energy-evse-stub.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/device-energy-management-stub.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/device-energy-management-stub.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/binding-handler.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/air-quality-instance.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/concentration-measurement-instances.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/resource-monitoring-delegates.cpp
${ENERGY_MANAGEMENT_COMMON_DIR}/src/EnergyTimeUtils.cpp
${ENERGY_MANAGEMENT_COMMON_DIR}/src/DeviceEnergyManagementDelegateImpl.cpp
${ENERGY_MANAGEMENT_COMMON_DIR}/src/DeviceEnergyManagementManager.cpp
${ENERGY_MANAGEMENT_COMMON_DIR}/src/EVSEManufacturerImpl.cpp
${ENERGY_MANAGEMENT_COMMON_DIR}/src/ElectricalPowerMeasurementDelegate.cpp
${ENERGY_MANAGEMENT_COMMON_DIR}/src/EnergyEvseDelegateImpl.cpp
${ENERGY_MANAGEMENT_COMMON_DIR}/src/EnergyEvseManager.cpp
Expand Down
2 changes: 2 additions & 0 deletions examples/all-clusters-app/nxp/mw320/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,11 @@ mw320_executable("shell_mw320") {
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/ElectricalPowerMeasurementDelegate.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyTimeUtils.cpp",
"${chip_root}/src/lib/shell/streamer_mw320.cpp",
"binding-handler.cpp",
"include/CHIPProjectConfig.h",
Expand Down
10 changes: 6 additions & 4 deletions examples/all-clusters-app/openiotsdk/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ target_include_directories(${APP_TARGET}
PRIVATE
main/include
${ALL_CLUSTERS_COMMON}/include
${ENERGY_MANAGEMENT_COMMON}/include
${ENERGY_MANAGEMENT_COMMON}/include
)

target_sources(${APP_TARGET}
Expand All @@ -60,16 +60,18 @@ target_sources(${APP_TARGET}
${ALL_CLUSTERS_COMMON}/src/concentration-measurement-instances.cpp
${ALL_CLUSTERS_COMMON}/src/fan-stub.cpp
${ALL_CLUSTERS_COMMON}/src/oven-modes.cpp
${ALL_CLUSTERS_COMMON}/src/device-energy-management-stub.cpp
${ALL_CLUSTERS_COMMON}/src/device-energy-management-stub.cpp
${ALL_CLUSTERS_COMMON}/src/energy-evse-stub.cpp
${ALL_CLUSTERS_COMMON}/src/resource-monitoring-delegates.cpp
${ALL_CLUSTERS_COMMON}/src/static-supported-modes-manager.cpp
${ALL_CLUSTERS_COMMON}/src/binding-handler.cpp
${ENERGY_MANAGEMENT_COMMON}/src/EnergyTimeUtils.cpp
${ENERGY_MANAGEMENT_COMMON}/src/DeviceEnergyManagementDelegateImpl.cpp
${ENERGY_MANAGEMENT_COMMON}/src/DeviceEnergyManagementManager.cpp
${ENERGY_MANAGEMENT_COMMON}/src/EVSEManufacturerImpl.cpp
${ENERGY_MANAGEMENT_COMMON}/src/ElectricalPowerMeasurementDelegate.cpp
${ENERGY_MANAGEMENT_COMMON}/src/EnergyEvseDelegateImpl.cpp
${ENERGY_MANAGEMENT_COMMON}/src/EnergyEvseManager.cpp
${ENERGY_MANAGEMENT_COMMON}/src/DeviceEnergyManagementDelegateImpl.cpp
${ENERGY_MANAGEMENT_COMMON}/src/DeviceEnergyManagementManager.cpp
)

target_link_libraries(${APP_TARGET}
Expand Down
10 changes: 6 additions & 4 deletions examples/all-clusters-app/telink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ project(chip-telink-all-clusters-app-example)
target_include_directories(app PRIVATE
include
${ALL_CLUSTERS_COMMON_DIR}/include
${ENERGY_MANAGEMENT_COMMON_DIR}/include
${ENERGY_MANAGEMENT_COMMON_DIR}/include
${GEN_DIR}/app-common
${GEN_DIR}/all-clusters-app
${TELINK_COMMON}/common/include
Expand All @@ -48,14 +48,16 @@ target_sources(app PRIVATE
${ALL_CLUSTERS_COMMON_DIR}/src/air-quality-instance.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/concentration-measurement-instances.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/fan-stub.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/device-energy-management-stub.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/device-energy-management-stub.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/energy-evse-stub.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/resource-monitoring-delegates.cpp
${ENERGY_MANAGEMENT_COMMON_DIR}/src/EnergyTimeUtils.cpp
${ENERGY_MANAGEMENT_COMMON_DIR}/src/DeviceEnergyManagementDelegateImpl.cpp
${ENERGY_MANAGEMENT_COMMON_DIR}/src/DeviceEnergyManagementManager.cpp
${ENERGY_MANAGEMENT_COMMON_DIR}/src/EVSEManufacturerImpl.cpp
${ENERGY_MANAGEMENT_COMMON_DIR}/src/ElectricalPowerMeasurementDelegate.cpp
${ENERGY_MANAGEMENT_COMMON_DIR}/src/EnergyEvseDelegateImpl.cpp
${ENERGY_MANAGEMENT_COMMON_DIR}/src/EnergyEvseManager.cpp
${ENERGY_MANAGEMENT_COMMON_DIR}/src/DeviceEnergyManagementDelegateImpl.cpp
${ENERGY_MANAGEMENT_COMMON_DIR}/src/DeviceEnergyManagementManager.cpp
${TELINK_COMMON}/common/src/mainCommon.cpp
${TELINK_COMMON}/common/src/AppTaskCommon.cpp
${TELINK_COMMON}/util/src/LEDManager.cpp
Expand Down
2 changes: 2 additions & 0 deletions examples/all-clusters-app/tizen/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ source_set("chip-all-clusters-common") {
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/ElectricalPowerMeasurementDelegate.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyTimeUtils.cpp",
]

deps = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2023 Project CHIP Authors
# Copyright (c) 2023-2024 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/*
*
* Copyright (c) 2024 Project CHIP Authors
* All rights reserved.
*
* 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.
*/

#pragma once

#include <app-common/zap-generated/cluster-objects.h>
#include <lib/core/DataModelTypes.h>

namespace chip {
namespace app {
namespace Clusters {
namespace DeviceEnergyManagement {

/**
* Class to abstract manufacturer specific functionality
*/
class DEMManufacturerDelegate
{
public:
DEMManufacturerDelegate() {}

virtual ~DEMManufacturerDelegate() {}

// The PowerAdjustEnd event needs to report the approximate energy used by the ESA during the session.
virtual int64_t GetApproxEnergyDuringSession() = 0;

virtual CHIP_ERROR HandleDeviceEnergyManagementPowerAdjustRequest(const int64_t powerMw, const uint32_t durationS,
AdjustmentCauseEnum cause)
{
return CHIP_NO_ERROR;
}

virtual CHIP_ERROR HandleDeviceEnergyManagementPowerAdjustCompletion() { return CHIP_NO_ERROR; }

virtual CHIP_ERROR HandleDeviceEnergyManagementCancelPowerAdjustRequest(CauseEnum cause) { return CHIP_NO_ERROR; }

virtual CHIP_ERROR HandleDeviceEnergyManagementStartTimeAdjustRequest(const uint32_t requestedStartTimeUtc,
AdjustmentCauseEnum cause)
{
return CHIP_NO_ERROR;
}

virtual CHIP_ERROR HandleDeviceEnergyManagementPauseRequest(const uint32_t durationS, AdjustmentCauseEnum cause)
{
return CHIP_NO_ERROR;
}

virtual CHIP_ERROR HandleDeviceEnergyManagementPauseCompletion() { return CHIP_NO_ERROR; }

virtual CHIP_ERROR HandleDeviceEnergyManagementCancelPauseRequest(CauseEnum cause) { return CHIP_NO_ERROR; }

virtual CHIP_ERROR HandleDeviceEnergyManagementCancelRequest() { return CHIP_NO_ERROR; }

virtual CHIP_ERROR
HandleModifyForecastRequest(const uint32_t forecastID,
const DataModel::DecodableList<Structs::SlotAdjustmentStruct::DecodableType> & slotAdjustments,
AdjustmentCauseEnum cause)
{
return CHIP_NO_ERROR;
}

virtual CHIP_ERROR RequestConstraintBasedForecast(
const DataModel::DecodableList<DeviceEnergyManagement::Structs::ConstraintsStruct::DecodableType> & constraints,
AdjustmentCauseEnum cause)
{
return CHIP_NO_ERROR;
}
};

} // namespace DeviceEnergyManagement
} // namespace Clusters
} // namespace app
} // namespace chip
Loading

0 comments on commit 1092309

Please sign in to comment.