Skip to content

Commit

Permalink
Merged DeviceEnergyManagement with the common one
Browse files Browse the repository at this point in the history
  • Loading branch information
lpbeliveau-silabs committed Sep 20, 2024
1 parent 2a89277 commit 19eae5a
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 1,248 deletions.
3 changes: 2 additions & 1 deletion examples/dishwasher-app/silabs/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,14 @@ silabs_executable("dishwasher_app") {

sources = [
"${example_enegy_management_dir}/energy-management-common/common/src/EnergyTimeUtils.cpp",
"${example_enegy_management_dir}/energy-management-common/device-energy-management/src/DeviceEnergyManagementDelegateImpl.cpp",
"${example_enegy_management_dir}/energy-management-common/device-energy-management/src/DeviceEnergyManagementManager.cpp",
"${example_enegy_management_dir}/energy-management-common/energy-reporting/src/ElectricalPowerMeasurementDelegate.cpp",
"${example_enegy_management_dir}/energy-management-common/energy-reporting/src/PowerTopologyDelegate.cpp",
"${examples_common_plat_dir}/main.cpp",
"src/AppTask.cpp",
"src/DEMTestEventTriggers.cpp",
"src/DataModelHelper.cpp",
"src/DeviceEnergyManagementDelegate.cpp",
"src/DeviceEnergyManagementModeDelegate.cpp",
"src/DeviceEnergyManager.cpp",
"src/DishwasherManager.cpp",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

#pragma once

#include "DeviceEnergyManagementDelegate.h"
#include "DeviceEnergyManagementModeDelegate.h"
#include <DeviceEnergyManagementDelegateImpl.h>

class DeviceEnergyManager
{
Expand Down
6 changes: 3 additions & 3 deletions examples/dishwasher-app/silabs/include/DishwasherManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include "AppEvent.h"
#include <DEMManufacturerDelegate.h>
#include <DeviceEnergyManagementDelegate.h>
#include <DeviceEnergyManagementManager.h>
#include <app-common/zap-generated/cluster-objects.h>
#include <app/clusters/operational-state-server/operational-state-server.h>
#include <lib/core/DataModelTypes.h>
Expand All @@ -37,7 +37,7 @@ class DishwasherManager : public DEMManufacturerDelegate
public:
static constexpr int64_t kApproximateEnergyUsedByESA = 1800'000; // mW

DishwasherManager(DeviceEnergyManagementInstance * aDEMInstance) : mDEMInstance(aDEMInstance) {}
DishwasherManager(DeviceEnergyManagementManager * aDEMInstance) : mDEMInstance(aDEMInstance) {}
virtual ~DishwasherManager() {}

CHIP_ERROR Init();
Expand Down Expand Up @@ -88,7 +88,7 @@ class DishwasherManager : public DEMManufacturerDelegate
Callback_fn_completed mActionCompleted_CB;

// DEM Manufacturer Delegate
DeviceEnergyManagementInstance * mDEMInstance;
DeviceEnergyManagementManager * mDEMInstance;
};

DishwasherManager * GetDishwasherManager();
Expand Down
13 changes: 2 additions & 11 deletions examples/dishwasher-app/silabs/src/DEMTestEventTriggers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@
* limitations under the License.
*/

#include <DeviceEnergyManagementDelegate.h>
#include <DEMDelegate.h>
#include <DeviceEnergyManager.h>
#include <app/clusters/device-energy-management-server/DeviceEnergyManagementTestEventTriggerHandler.h>

#include <EnergyTimeUtils.h>
#include <app/clusters/device-energy-management-server/DeviceEnergyManagementTestEventTriggerHandler.h>

#include "FakeReadingsImpl.h"

Expand All @@ -41,14 +40,6 @@ static chip::app::Clusters::DeviceEnergyManagement::Structs::PowerAdjustCapabili
static chip::app::DataModel::Nullable<chip::app::Clusters::DeviceEnergyManagement::Structs::PowerAdjustCapabilityStruct::Type>
sPowerAdjustmentCapability;

DeviceEnergyManagementDelegate * GetDEMDelegate()
{
DeviceEnergyManagementDelegate * dg = DeviceEnergyManager::Instance().GetDEMDelegate();
VerifyOrDieWithMsg(dg != nullptr, AppServer, "DEM Delegate is null");

return dg;
}

CHIP_ERROR ConfigureForecast(uint16_t numSlots)
{
uint32_t chipEpoch = 0;
Expand Down
Loading

0 comments on commit 19eae5a

Please sign in to comment.