Add Sankey chart to the energy dashboard (#26192)

* Add Sankey chart to the energy dashboard

* hide floors & areas if there is an explicit hierarchy
This commit is contained in:
Petar Petrov 2025-07-18 07:30:21 +03:00 committed by GitHub
parent 5f2b11ca9f
commit 1b68c51a05
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -184,6 +184,16 @@ export class EnergyViewStrategy extends ReactiveElement {
type: "energy-devices-graph", type: "energy-devices-graph",
collection_key: "energy_dashboard", collection_key: "energy_dashboard",
}); });
const showFloorsNAreas = !prefs.device_consumption.some(
(d) => d.included_in_stat
);
view.cards!.push({
title: hass.localize("ui.panel.energy.cards.energy_sankey_title"),
type: "energy-sankey",
collection_key: "energy_dashboard",
group_by_floor: showFloorsNAreas,
group_by_area: showFloorsNAreas,
});
} }
return view; return view;