From c9737af849c5281ca39e66572269aa1511b303b8 Mon Sep 17 00:00:00 2001 From: Dave T <17680170+davet2001@users.noreply.github.com> Date: Sun, 5 Jan 2025 20:40:04 +0000 Subject: [PATCH] Fix error when clicking grid input on energy graph --- src/hui-energy-elec-flow-card.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hui-energy-elec-flow-card.ts b/src/hui-energy-elec-flow-card.ts index 93353eb..1e9e191 100644 --- a/src/hui-energy-elec-flow-card.ts +++ b/src/hui-energy-elec-flow-card.ts @@ -121,8 +121,9 @@ export class HuiEnergyElecFlowCard energyData.stats, types.grid![0].flow_from.map((flow) => flow.stat_energy_from) ) ?? 0; + const gridInId = types.grid![0].flow_from[0].stat_energy_from; this._gridInRoute = { - id: "grid-in-all", + id: gridInId, rate: totalFromGrid, }; @@ -131,8 +132,9 @@ export class HuiEnergyElecFlowCard energyData.stats, types.grid![0].flow_to.map((flow) => flow.stat_energy_to) ) ?? 0; + const gridOutId = types.grid![0].flow_to[0].stat_energy_to; this._gridOutRoute = { - id: "grid-out-all", + id: gridOutId, rate: totalToGrid, };