Skip to content

Commit 74c9173

Browse files
committed
Bug fix - When disabling the mMaximumChargingCurrentLimitFromCommand was not being updated, so we didn't get attribute updates for MaximumChargeCurrent when toggling Enable-Disable-Enable.
1 parent ef9727c commit 74c9173

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed

examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp

+3-19
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ Status EnergyEvseDelegate::Disable()
6363

6464
/* update MinimumChargeCurrent & MaximumChargeCurrent to 0 */
6565
SetMinimumChargeCurrent(0);
66-
SetMaximumChargeCurrent(0);
66+
67+
mMaximumChargingCurrentLimitFromCommand = 0;
68+
ComputeMaxChargeCurrentLimit();
6769

6870
/* update MaximumDischargeCurrent to 0 */
6971
SetMaximumDischargeCurrent(0);
@@ -1360,24 +1362,6 @@ int64_t EnergyEvseDelegate::GetMaximumChargeCurrent()
13601362
return mMaximumChargeCurrent;
13611363
}
13621364

1363-
CHIP_ERROR EnergyEvseDelegate::SetMaximumChargeCurrent(int64_t newValue)
1364-
{
1365-
int64_t oldValue = mMaximumChargeCurrent;
1366-
1367-
if (newValue >= kMaximumChargeCurrent)
1368-
{
1369-
return CHIP_IM_GLOBAL_STATUS(ConstraintError);
1370-
}
1371-
1372-
mMaximumChargeCurrent = newValue;
1373-
if (oldValue != mMaximumChargeCurrent)
1374-
{
1375-
ChipLogDetail(AppServer, "MaximumChargeCurrent updated to %ld", static_cast<long>(mMaximumChargeCurrent));
1376-
MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, MaximumChargeCurrent::Id);
1377-
}
1378-
return CHIP_NO_ERROR;
1379-
}
1380-
13811365
/* MaximumDischargeCurrent */
13821366
int64_t EnergyEvseDelegate::GetMaximumDischargeCurrent()
13831367
{

0 commit comments

Comments
 (0)