Show energy-self-sufficiency-gauge card without grid return (#24098)

Show energy-self-sufficiency-gauge card if solar is defined
This commit is contained in:
Petar Petrov 2025-02-06 12:07:06 +02:00 committed by GitHub
parent 16181b48ae
commit de3bf2e088
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -140,12 +140,14 @@ export class EnergyViewStrategy extends ReactiveElement {
}
// Only include if we have a solar source.
if (hasSolar && hasReturn) {
view.cards!.push({
type: "energy-solar-consumed-gauge",
view_layout: { position: "sidebar" },
collection_key: "energy_dashboard",
});
if (hasSolar) {
if (hasReturn) {
view.cards!.push({
type: "energy-solar-consumed-gauge",
view_layout: { position: "sidebar" },
collection_key: "energy_dashboard",
});
}
view.cards!.push({
type: "energy-self-sufficiency-gauge",
view_layout: { position: "sidebar" },