Skip to content

Commit b8d55ce

Browse files
committed
Address further review comments from Boris
1 parent 3c57718 commit b8d55ce

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

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

+6-16
Original file line numberDiff line numberDiff line change
@@ -889,14 +889,9 @@ DeviceEnergyManagementDelegate::SetPowerAdjustmentCapability(
889889
{
890890
assertChipStackLockedByCurrentThread();
891891

892-
if (powerAdjustCapabilityStruct.IsNull())
893-
{
894-
mPowerAdjustCapabilityStruct.SetNull();
895-
}
896-
else
897-
{
898-
mPowerAdjustCapabilityStruct = powerAdjustCapabilityStruct;
899-
}
892+
mPowerAdjustCapabilityStruct = powerAdjustCapabilityStruct;
893+
894+
MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, PowerAdjustmentCapability::Id);
900895

901896
return CHIP_NO_ERROR;
902897
}
@@ -906,14 +901,9 @@ CHIP_ERROR DeviceEnergyManagementDelegate::SetForecast(const DataModel::Nullable
906901
assertChipStackLockedByCurrentThread();
907902

908903
// TODO see Issue #31147
909-
if (forecast.IsNull())
910-
{
911-
mForecast.SetNull();
912-
}
913-
else
914-
{
915-
mForecast = forecast;
916-
}
904+
mForecast = forecast;
905+
906+
MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, Forecast::Id);
917907

918908
return CHIP_NO_ERROR;
919909
}

0 commit comments

Comments
 (0)