From 0ca2eb8287d148ead71cc098ccb1f0901bcfe793 Mon Sep 17 00:00:00 2001 From: Patrick Amrhein Date: Wed, 27 Mar 2024 18:31:52 +0100 Subject: [PATCH] Bugfix: newDataAvailable ivL --- src/plugins/zeroExport/zeroExport.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/zeroExport/zeroExport.h b/src/plugins/zeroExport/zeroExport.h index 7035a279..de3626f9 100644 --- a/src/plugins/zeroExport/zeroExport.h +++ b/src/plugins/zeroExport/zeroExport.h @@ -273,9 +273,10 @@ class ZeroExport { mLog["a"] = iv->isAvailable(); mLog["ivL%"] = iv->actPowerLimit; mLog["ivPm"] = iv->getMaxPower(); - mLog["ivL"] = (uint16_t)(iv->getMaxPower() / 100 * iv->actPowerLimit); + uint16_t ivL = (iv->getMaxPower() * iv->actPowerLimit) / 100; + mLog["ivL"] = ivL; mLog["zeL"] = (uint16_t)mCfg->groups[group].inverters[inv].limit; - mCfg->groups[group].inverters[inv].limit = (iv->getMaxPower() / 100 * iv->actPowerLimit); + mCfg->groups[group].inverters[inv].limit = ivL; unsigned long eTsp = millis(); mLog["B"] = bTsp; mLog["E"] = eTsp;