diff --git a/examples/all-clusters-app/all-clusters-common/include/WhmDelegate.h b/examples/all-clusters-app/all-clusters-common/include/WhmDelegate.h index ecabfe22792f25..ad73239e77990d 100644 --- a/examples/all-clusters-app/all-clusters-common/include/WhmDelegate.h +++ b/examples/all-clusters-app/all-clusters-common/include/WhmDelegate.h @@ -167,7 +167,7 @@ class WaterHeaterManagementDelegate : public WaterHeaterManagement::Delegate * @param percentageReplaced The % of water being replaced with water with a temperature of replacedWaterTemperature. * @param replacedWaterTemperature The temperature of the percentageReplaced water. */ - void DrawOffHotWater(uint8_t percentageReplaced, uint16_t replacedWaterTemperature); + void DrawOffHotWater(chip::Percent percentageReplaced, uint16_t replacedWaterTemperature); private: /** diff --git a/examples/all-clusters-app/all-clusters-common/src/WhmDelegateImpl.cpp b/examples/all-clusters-app/all-clusters-common/src/WhmDelegateImpl.cpp index fd19a3c59d740b..0568e5c9c7d002 100644 --- a/examples/all-clusters-app/all-clusters-common/src/WhmDelegateImpl.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/WhmDelegateImpl.cpp @@ -294,7 +294,7 @@ void WaterHeaterManagementDelegate::SetTargetWaterTemperature(uint16_t targetWat CheckIfHeatNeedsToBeTurnedOnOrOff(); } -void WaterHeaterManagementDelegate::DrawOffHotWater(uint8_t percentageReplaced, uint16_t replacedWaterTemperature) +void WaterHeaterManagementDelegate::DrawOffHotWater(Percent percentageReplaced, uint16_t replacedWaterTemperature) { // Only supported in the kTankPercent is supported. // Replaces percentageReplaced% of the water in the tank with water of a temperature replacedWaterTemperature @@ -303,7 +303,7 @@ void WaterHeaterManagementDelegate::DrawOffHotWater(uint8_t percentageReplaced, // See if all of the water has now been replaced with replacedWaterTemperature if (mTankPercentage >= percentageReplaced) { - mTankPercentage -= percentageReplaced; + mTankPercentage = static_cast(mTankPercentage - percentageReplaced); } else {