Skip to content

Commit

Permalink
Get tests passing again
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterC1965 committed Jul 25, 2024
1 parent b017a85 commit 58fcfa7
Showing 1 changed file with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,6 @@ void WaterHeaterManagementDelegate::SetWaterTemperature(uint16_t waterTemperatur
{
mHotWaterTemperature = waterTemperature;

// Do not change mTankPercentage if the kTankPercent feature is not supported
if (mpWhmInstance != nullptr && mpWhmInstance->HasFeature(Feature::kTankPercent))
{
mTankPercentage = 100;
Expand Down Expand Up @@ -362,8 +361,24 @@ bool WaterHeaterManagementDelegate::HasWaterTemperatureReachedTarget() const
(mBoostState == BoostStateEnum::kActive && mBoostTargetPercentage.HasValue()) ? mBoostTargetPercentage.Value() : 100;
}

// Return whether the water is at the target temperature
return (mTankPercentage >= targetPercentage) && (mHotWaterTemperature >= targetTemperature);

// Determine whether the water is at the target temperature
bool tempReached = true;
if (mpWhmInstance != nullptr && mpWhmInstance->HasFeature(Feature::kTankPercent))
{
if (mTankPercentage < targetPercentage)
{
tempReached = false;
}
}

if (mHotWaterTemperature < targetTemperature)
{
tempReached = false;
}


return tempReached;
}

Status WaterHeaterManagementDelegate::CheckIfHeatNeedsToBeTurnedOnOrOff()
Expand Down

0 comments on commit 58fcfa7

Please sign in to comment.