File tree Expand file tree Collapse file tree 1 file changed +1
-16
lines changed
src/panels/energy/strategies Expand file tree Collapse file tree 1 file changed +1
-16
lines changed Original file line number Diff line number Diff line change @@ -8,14 +8,6 @@ import type { LovelaceStrategyConfig } from "../../../data/lovelace/config/strat
88import type { LovelaceSectionConfig } from "../../../data/lovelace/config/section" ;
99import { DEFAULT_ENERGY_COLLECTION_KEY } from "../ha-panel-energy" ;
1010
11- const sourceHasCost = ( source : Record < string , any > ) : boolean =>
12- Boolean (
13- source . stat_cost ||
14- source . stat_compensation ||
15- source . entity_energy_price ||
16- source . number_energy_price
17- ) ;
18-
1911@customElement ( "energy-overview-view-strategy" )
2012export class EnergyOverviewViewStrategy extends ReactiveElement {
2113 static async generate (
@@ -68,13 +60,6 @@ export class EnergyOverviewViewStrategy extends ReactiveElement {
6860 ( source . type === "battery" && source . stat_rate ) ||
6961 ( source . type === "grid" && source . power ?. length )
7062 ) ;
71- const hasCost = prefs . energy_sources . some (
72- ( source ) =>
73- sourceHasCost ( source ) ||
74- ( source . type === "grid" &&
75- ( source . flow_from ?. some ( sourceHasCost ) ||
76- source . flow_to ?. some ( sourceHasCost ) ) )
77- ) ;
7863
7964 const overviewSection : LovelaceSectionConfig = {
8065 type : "grid" ,
@@ -95,7 +80,7 @@ export class EnergyOverviewViewStrategy extends ReactiveElement {
9580 }
9681 view . sections ! . push ( overviewSection ) ;
9782
98- if ( hasCost ) {
83+ if ( prefs . energy_sources . length ) {
9984 view . sections ! . push ( {
10085 type : "grid" ,
10186 cards : [
You can’t perform that action at this time.
0 commit comments