From c13bece6d0a6cce6a967b6ff60b60127af888301 Mon Sep 17 00:00:00 2001 From: eringerli <48175951+eringerli@users.noreply.github.com> Date: Mon, 1 Dec 2025 07:25:47 +0100 Subject: [PATCH] fix stacking of multiple power sources (#28243) --- .../lovelace/cards/energy/hui-power-sources-graph-card.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/panels/lovelace/cards/energy/hui-power-sources-graph-card.ts b/src/panels/lovelace/cards/energy/hui-power-sources-graph-card.ts index 9f889e27ca..efffa3f819 100644 --- a/src/panels/lovelace/cards/energy/hui-power-sources-graph-card.ts +++ b/src/panels/lovelace/cards/energy/hui-power-sources-graph-card.ts @@ -323,9 +323,9 @@ export class HuiPowerSourcesGraphCard const negative: [number, number][] = []; Object.entries(data).forEach(([x, y]) => { const ts = Number(x); - const meanY = y.reduce((a, b) => a + b, 0) / y.length; - positive.push([ts, Math.max(0, meanY)]); - negative.push([ts, Math.min(0, meanY)]); + const sumY = y.reduce((a, b) => a + b, 0); + positive.push([ts, Math.max(0, sumY)]); + negative.push([ts, Math.min(0, sumY)]); }); return { positive, negative }; }