18
18
19
19
#include < DeviceEnergyManagementDelegateImpl.h>
20
20
#include < EVSEManufacturerImpl.h>
21
+ #include < DEMDelegate.h>
21
22
#include < app/clusters/device-energy-management-server/DeviceEnergyManagementTestEventTriggerHandler.h>
22
23
23
24
#include < EnergyTimeUtils.h>
@@ -41,16 +42,6 @@ static chip::app::Clusters::DeviceEnergyManagement::Structs::PowerAdjustCapabili
41
42
static chip::app::DataModel::Nullable<chip::app::Clusters::DeviceEnergyManagement::Structs::PowerAdjustCapabilityStruct::Type>
42
43
sPowerAdjustmentCapability ;
43
44
44
- DeviceEnergyManagementDelegate * GetDEMDelegate ()
45
- {
46
- EVSEManufacturer * mn = GetEvseManufacturer ();
47
- VerifyOrDieWithMsg (mn != nullptr , AppServer, " EVSEManufacturer is null" );
48
- DeviceEnergyManagementDelegate * dg = mn->GetDEMDelegate ();
49
- VerifyOrDieWithMsg (dg != nullptr , AppServer, " DEM Delegate is null" );
50
-
51
- return dg;
52
- }
53
-
54
45
CHIP_ERROR ConfigureForecast (uint16_t numSlots)
55
46
{
56
47
uint32_t chipEpoch = 0 ;
@@ -134,10 +125,9 @@ CHIP_ERROR ConfigureForecast(uint16_t numSlots)
134
125
135
126
sForecastStruct .slots = DataModel::List<const DeviceEnergyManagement::Structs::SlotStruct::Type>(sSlots , numSlots);
136
127
137
- EVSEManufacturer * mn = GetEvseManufacturer ();
138
- mn->GetDEMDelegate ()->SetForecast (DataModel::MakeNullable (sForecastStruct ));
139
- mn->GetDEMDelegate ()->SetAbsMinPower (1000 );
140
- mn->GetDEMDelegate ()->SetAbsMaxPower (256 * 2000 * 1000 );
128
+ GetDEMDelegate ()->SetForecast (DataModel::MakeNullable (sForecastStruct ));
129
+ GetDEMDelegate ()->SetAbsMinPower (1000 );
130
+ GetDEMDelegate ()->SetAbsMaxPower (256 * 2000 * 1000 );
141
131
142
132
return CHIP_NO_ERROR;
143
133
}
0 commit comments