Skip to content

Commit

Permalink
Restyled by clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits authored and PeterC1965 committed Aug 13, 2024
1 parent 20fadc5 commit 4677782
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,7 @@ uint16_t WaterHeaterManagementDelegate::GetActiveTargetWaterTemperature() const

uint8_t WaterHeaterManagementDelegate::CalculateTankPercentage() const
{
int16_t tankPercentage =
100 * (static_cast<int16_t>(mWaterTemperature) - static_cast<int16_t>(mColdWaterTemperature)) /
int16_t tankPercentage = 100 * (static_cast<int16_t>(mWaterTemperature) - static_cast<int16_t>(mColdWaterTemperature)) /
(static_cast<int16_t>(GetActiveTargetWaterTemperature()) - static_cast<int16_t>(mColdWaterTemperature));

tankPercentage = std::min(tankPercentage, static_cast<int16_t>(100));
Expand Down Expand Up @@ -356,7 +355,8 @@ void WaterHeaterManagementDelegate::SetTargetWaterTemperature(uint16_t targetWat
void WaterHeaterManagementDelegate::DrawOffHotWater(Percent percentageReplaced, uint16_t replacedWaterTemperature)
{
// First calculate the new average water temperature
mWaterTemperature = (mWaterTemperature * static_cast<uint16_t>(100 - percentageReplaced) + replacedWaterTemperature * percentageReplaced) / 100;
mWaterTemperature =
(mWaterTemperature * static_cast<uint16_t>(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

0 comments on commit 4677782

Please sign in to comment.