1
0
mirror of https://github.com/home-assistant/frontend.git synced 2026-04-02 00:27:49 +01:00

Fix hasReturnToGrid only checking first grid source in energy distribution card (#30273)

This commit is contained in:
Petar Petrov
2026-03-23 09:55:22 +01:00
committed by GitHub
parent 8ac831679d
commit 9979bb13ea

View File

@@ -137,7 +137,8 @@ class HuiEnergyDistrubutionCard
const hasBattery = types.battery !== undefined;
const hasGas = types.gas !== undefined;
const hasWater = types.water !== undefined;
const hasReturnToGrid = !!types.grid?.[0] && !!types.grid[0].stat_energy_to;
const hasReturnToGrid =
types.grid?.some((source) => !!source.stat_energy_to) ?? false;
const { summedData, compareSummedData: _ } = getSummedData(this._data);
const { consumption, compareConsumption: __ } = computeConsumptionData(