Skip to content

Commit c5a759a

Browse files
committedAug 13, 2024
Fix some CI build issues
1 parent 4677782 commit c5a759a

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed
 

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -316,11 +316,11 @@ uint16_t WaterHeaterManagementDelegate::GetActiveTargetWaterTemperature() const
316316

317317
uint8_t WaterHeaterManagementDelegate::CalculateTankPercentage() const
318318
{
319-
int16_t tankPercentage = 100 * (static_cast<int16_t>(mWaterTemperature) - static_cast<int16_t>(mColdWaterTemperature)) /
320-
(static_cast<int16_t>(GetActiveTargetWaterTemperature()) - static_cast<int16_t>(mColdWaterTemperature));
319+
int32_t tankPercentage = 100 * (static_cast<int32_t>(mWaterTemperature) - static_cast<int32_t>(mColdWaterTemperature)) /
320+
(static_cast<int32_t>(GetActiveTargetWaterTemperature()) - static_cast<int32_t>(mColdWaterTemperature));
321321

322-
tankPercentage = std::min(tankPercentage, static_cast<int16_t>(100));
323-
tankPercentage = std::max(tankPercentage, static_cast<int16_t>(0));
322+
tankPercentage = std::min(tankPercentage, static_cast<int32_t>(100));
323+
tankPercentage = std::max(tankPercentage, static_cast<int32_t>(0));
324324

325325
return static_cast<uint8_t>(tankPercentage);
326326
}
@@ -356,7 +356,7 @@ void WaterHeaterManagementDelegate::DrawOffHotWater(Percent percentageReplaced,
356356
{
357357
// First calculate the new average water temperature
358358
mWaterTemperature =
359-
(mWaterTemperature * static_cast<uint16_t>(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.

‎src/python_testing/TC_EWATERHTR_2_2.py

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import time
3333

3434
import chip.clusters as Clusters
35-
from chip.clusters.Types import NullValue
3635
from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main
3736
from mobly import asserts
3837
from TC_EWATERHTRBase import EWATERHTRBase

0 commit comments

Comments
 (0)