From 20fadc5b7283991c499d78c56641a82ce0f6f332 Mon Sep 17 00:00:00 2001 From: pcoleman Date: Tue, 13 Aug 2024 10:07:08 +0100 Subject: [PATCH] Fix failing CI build --- .../all-clusters-common/src/WhmDelegateImpl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/src/WhmDelegateImpl.cpp b/examples/all-clusters-app/all-clusters-common/src/WhmDelegateImpl.cpp index 15b8d50535c56c..b657fb83fc3000 100644 --- a/examples/all-clusters-app/all-clusters-common/src/WhmDelegateImpl.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/WhmDelegateImpl.cpp @@ -317,7 +317,8 @@ uint16_t WaterHeaterManagementDelegate::GetActiveTargetWaterTemperature() const uint8_t WaterHeaterManagementDelegate::CalculateTankPercentage() const { int16_t tankPercentage = - 100 * (mWaterTemperature - mColdWaterTemperature) / (GetActiveTargetWaterTemperature() - mColdWaterTemperature); + 100 * (static_cast(mWaterTemperature) - static_cast(mColdWaterTemperature)) / + (static_cast(GetActiveTargetWaterTemperature()) - static_cast(mColdWaterTemperature)); tankPercentage = std::min(tankPercentage, static_cast(100)); tankPercentage = std::max(tankPercentage, static_cast(0)); @@ -355,7 +356,7 @@ void WaterHeaterManagementDelegate::SetTargetWaterTemperature(uint16_t targetWat void WaterHeaterManagementDelegate::DrawOffHotWater(Percent percentageReplaced, uint16_t replacedWaterTemperature) { // First calculate the new average water temperature - mWaterTemperature = (mWaterTemperature * (100 - percentageReplaced) + replacedWaterTemperature * percentageReplaced) / 100; + mWaterTemperature = (mWaterTemperature * static_cast(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.