diff --git a/src/PowerLimiter.cpp b/src/PowerLimiter.cpp index 1ac10c74..b84cecc1 100644 --- a/src/PowerLimiter.cpp +++ b/src/PowerLimiter.cpp @@ -587,9 +587,8 @@ bool PowerLimiterClass::isStartThresholdReached(std::shared_ptr 0.0 - && (millis() - Battery.stateOfChargeLastUpdate) < 60000 - && Battery.stateOfCharge >= config.PowerLimiter_BatterySocStartThreshold) { - return true; + && (millis() - Battery.stateOfChargeLastUpdate) < 60000) { + return Battery.stateOfCharge >= config.PowerLimiter_BatterySocStartThreshold; } // Otherwise we use the voltage threshold @@ -608,9 +607,8 @@ bool PowerLimiterClass::isStopThresholdReached(std::shared_ptr // Check if the Battery interface is enabled and the SOC stop threshold is reached if (config.Battery_Enabled && config.PowerLimiter_BatterySocStopThreshold > 0.0 - && (millis() - Battery.stateOfChargeLastUpdate) < 60000 - && Battery.stateOfCharge <= config.PowerLimiter_BatterySocStopThreshold) { - return true; + && (millis() - Battery.stateOfChargeLastUpdate) < 60000) { + return Battery.stateOfCharge <= config.PowerLimiter_BatterySocStopThreshold; } // Otherwise we use the voltage threshold @@ -674,9 +672,8 @@ bool PowerLimiterClass::useFullSolarPassthrough(std::shared_ptr 0.0 - && (millis() - Battery.stateOfChargeLastUpdate) < 60000 - && Battery.stateOfCharge >= config.PowerLimiter_FullSolarPassThroughSoc) { - return true; + && (millis() - Battery.stateOfChargeLastUpdate) < 60000) { + return Battery.stateOfCharge >= config.PowerLimiter_FullSolarPassThroughSoc; } // Otherwise we use the voltage threshold