This commit is contained in:
Mathieu Carbou 2025-01-24 19:52:42 +00:00 committed by GitHub
commit 9556f4e49a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -47,7 +47,11 @@ float SystemConfigParaParser::getLimitPercent() const
HOY_SEMAPHORE_TAKE(); HOY_SEMAPHORE_TAKE();
const float ret = ((static_cast<uint16_t>(_payload[2]) << 8) | _payload[3]) / 10.0; const float ret = ((static_cast<uint16_t>(_payload[2]) << 8) | _payload[3]) / 10.0;
HOY_SEMAPHORE_GIVE(); HOY_SEMAPHORE_GIVE();
return ret;
// don't pretend the inverter could produce more than its rated power,
// even though it does process, accept, and even save limit values beyond
// its rated power.
return min<float>(100, ret);
} }
void SystemConfigParaParser::setLimitPercent(const float value) void SystemConfigParaParser::setLimitPercent(const float value)