Skip to content

Commit c8a0dda

Browse files
committed
Get tank percentage calculation and expected result correct
1 parent 561e8a3 commit c8a0dda

File tree

2 files changed

+100
-122
lines changed

2 files changed

+100
-122
lines changed

examples/all-clusters-app/all-clusters-common/src/WhmDelegateImpl.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ void WaterHeaterManagementDelegate::DrawOffHotWater(Percent percentageReplaced,
356356
{
357357
// First calculate the new average water temperature
358358
mWaterTemperature =
359-
static_cast<uint16_t>(mWaterTemperature * (100 - percentageReplaced) + replacedWaterTemperature * percentageReplaced) / 100;
359+
static_cast<uint16_t>((mWaterTemperature * (100 - percentageReplaced) + replacedWaterTemperature * percentageReplaced) / 100);
360360

361361
// Replaces percentageReplaced% of the water in the tank with water of a temperature replacedWaterTemperature
362362
// Only supported if the kTankPercent feature is supported.

0 commit comments

Comments
 (0)