Skip to content

Commit

Permalink
Fix error when clicking grid input on energy graph
Browse files Browse the repository at this point in the history
  • Loading branch information
davet2001 committed Jan 5, 2025
1 parent dc67e89 commit c9737af
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/hui-energy-elec-flow-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

Expand All @@ -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,
};

Expand Down

0 comments on commit c9737af

Please sign in to comment.