mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-14 04:46:34 +00:00
If we have solar defined, always make sure sum is number so it shows placeholders (#9634)
This commit is contained in:
parent
9c31b749d7
commit
f87d4a5ab6
@ -86,19 +86,21 @@ class HuiEnergyDistrubutionCard extends LitElement implements LovelaceCard {
|
||||
let totalSolarProduction: number | null = null;
|
||||
|
||||
if (hasSolarProduction) {
|
||||
totalSolarProduction = calculateStatisticsSumGrowth(
|
||||
totalSolarProduction =
|
||||
calculateStatisticsSumGrowth(
|
||||
this._stats,
|
||||
types.solar!.map((source) => source.stat_energy_from)
|
||||
);
|
||||
) || 0;
|
||||
}
|
||||
|
||||
let productionReturnedToGrid: number | null = null;
|
||||
|
||||
if (hasReturnToGrid) {
|
||||
productionReturnedToGrid = calculateStatisticsSumGrowth(
|
||||
productionReturnedToGrid =
|
||||
calculateStatisticsSumGrowth(
|
||||
this._stats,
|
||||
types.grid![0].flow_to.map((flow) => flow.stat_energy_to)
|
||||
);
|
||||
) || 0;
|
||||
}
|
||||
|
||||
const totalConsumption =
|
||||
@ -191,7 +193,7 @@ class HuiEnergyDistrubutionCard extends LitElement implements LovelaceCard {
|
||||
: ""}${round(totalGridConsumption, 1)}
|
||||
kWh
|
||||
</span>
|
||||
${productionReturnedToGrid
|
||||
${productionReturnedToGrid !== null
|
||||
? html`<span class="return">
|
||||
<ha-svg-icon
|
||||
class="small"
|
||||
|
Loading…
x
Reference in New Issue
Block a user