@@ -129,12 +129,15 @@ export class EnergyViewStrategy extends ReactiveElement {
129129
130130 // Only include if we have at least 1 device in the config.
131131 if ( prefs . device_consumption . length ) {
132+ const showFloorsNAreas = ! prefs . device_consumption . some (
133+ ( d ) => d . included_in_stat
134+ ) ;
132135 view . cards ! . push ( {
133- title : hass . localize (
134- "ui.panel.energy.cards.energy_devices_detail_graph_title"
135- ) ,
136- type : "energy-devices-detail-graph" ,
136+ title : hass . localize ( "ui.panel.energy.cards.energy_sankey_title" ) ,
137+ type : "energy-sankey" ,
137138 collection_key : "energy_dashboard" ,
139+ group_by_floor : showFloorsNAreas ,
140+ group_by_area : showFloorsNAreas ,
138141 } ) ;
139142 view . cards ! . push ( {
140143 title : hass . localize (
@@ -143,15 +146,12 @@ export class EnergyViewStrategy extends ReactiveElement {
143146 type : "energy-devices-graph" ,
144147 collection_key : "energy_dashboard" ,
145148 } ) ;
146- const showFloorsNAreas = ! prefs . device_consumption . some (
147- ( d ) => d . included_in_stat
148- ) ;
149149 view . cards ! . push ( {
150- title : hass . localize ( "ui.panel.energy.cards.energy_sankey_title" ) ,
151- type : "energy-sankey" ,
150+ title : hass . localize (
151+ "ui.panel.energy.cards.energy_devices_detail_graph_title"
152+ ) ,
153+ type : "energy-devices-detail-graph" ,
152154 collection_key : "energy_dashboard" ,
153- group_by_floor : showFloorsNAreas ,
154- group_by_area : showFloorsNAreas ,
155155 } ) ;
156156 }
157157
0 commit comments