Skip to content

Commit

Permalink
Get tank percentage calculation and expected result correct
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterC1965 committed Aug 23, 2024
1 parent 561e8a3 commit c8a0dda
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 122 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ void WaterHeaterManagementDelegate::DrawOffHotWater(Percent percentageReplaced,
{
// First calculate the new average water temperature
mWaterTemperature =
static_cast<uint16_t>(mWaterTemperature * (100 - percentageReplaced) + replacedWaterTemperature * percentageReplaced) / 100;
static_cast<uint16_t>((mWaterTemperature * (100 - percentageReplaced) + replacedWaterTemperature * percentageReplaced) / 100);

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

0 comments on commit c8a0dda

Please sign in to comment.