From 6050f3afc2547db639c69b3d06f75a3443279e7b Mon Sep 17 00:00:00 2001 From: Francis De Paemeleere Date: Sun, 13 Apr 2025 12:36:26 +0200 Subject: [PATCH] be sure both directions for grid/batt have the correct speed --- src/power-flow-card-plus.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/power-flow-card-plus.ts b/src/power-flow-card-plus.ts index 4eaa73a2..82ac6339 100644 --- a/src/power-flow-card-plus.ts +++ b/src/power-flow-card-plus.ts @@ -463,7 +463,7 @@ export class PowerFlowCardPlus extends LitElement { // Compute durations const newDur: NewDur = { - batteryGrid: computeFlowRate(this._config, grid.state.toBattery ?? battery.state.toGrid ?? 0, totalLines), + batteryGrid: computeFlowRate(this._config, Math.max(grid.state.toBattery ?? 0, battery.state.toGrid ?? 0, 0), totalLines), batteryToHome: computeFlowRate(this._config, battery.state.toHome ?? 0, totalLines), gridToHome: computeFlowRate(this._config, grid.state.toHome, totalLines), solarToBattery: computeFlowRate(this._config, solar.state.toBattery ?? 0, totalLines),