Skip to content

Commit

Permalink
Fix some CI build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterC1965 committed Aug 13, 2024
1 parent 4677782 commit c5a759a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -316,11 +316,11 @@ uint16_t WaterHeaterManagementDelegate::GetActiveTargetWaterTemperature() const

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

tankPercentage = std::min(tankPercentage, static_cast<int16_t>(100));
tankPercentage = std::max(tankPercentage, static_cast<int16_t>(0));
tankPercentage = std::min(tankPercentage, static_cast<int32_t>(100));
tankPercentage = std::max(tankPercentage, static_cast<int32_t>(0));

return static_cast<uint8_t>(tankPercentage);
}
Expand Down Expand Up @@ -356,7 +356,7 @@ void WaterHeaterManagementDelegate::DrawOffHotWater(Percent percentageReplaced,
{
// First calculate the new average water temperature
mWaterTemperature =
(mWaterTemperature * static_cast<uint16_t>(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
1 change: 0 additions & 1 deletion src/python_testing/TC_EWATERHTR_2_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import time

import chip.clusters as Clusters
from chip.clusters.Types import NullValue
from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main
from mobly import asserts
from TC_EWATERHTRBase import EWATERHTRBase
Expand Down

0 comments on commit c5a759a

Please sign in to comment.