File tree Expand file tree Collapse file tree
src/panels/lovelace/cards/energy Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -109,7 +109,9 @@ export class HuiEnergySourcesTableCard
109109 name ?: string
110110 ) {
111111 const displayPrecision =
112- type === "gas" ? this . hass . entities [ statId ] ?. dp : undefined ;
112+ type === "gas"
113+ ? this . hass . entities [ statId ] ?. display_precision
114+ : undefined ;
113115
114116 const formatOptions =
115117 displayPrecision !== undefined
@@ -118,7 +120,7 @@ export class HuiEnergySourcesTableCard
118120 maximumFractionDigits : displayPrecision ,
119121 }
120122 : undefined ;
121-
123+
122124 return html `<tr
123125 class= "mdc-data-table__row ${ classMap ( {
124126 clickable : ! isExternalStatistic ( statId ) ,
@@ -340,7 +342,10 @@ export class HuiEnergySourcesTableCard
340342 : allTypes ;
341343
342344 const gasDisplayPrecisions = types . gas
343- ?. map ( ( source ) => this . hass . entities [ source . stat_energy_from ] ?. dp )
345+ ?. map (
346+ ( source ) =>
347+ this . hass . entities [ source . stat_energy_from ] ?. display_precision
348+ )
344349 . filter ( ( precision ) : precision is number => precision !== undefined ) ;
345350
346351 const gasDisplayPrecision = gasDisplayPrecisions ?. length
@@ -354,7 +359,7 @@ export class HuiEnergySourcesTableCard
354359 maximumFractionDigits : gasDisplayPrecision ,
355360 }
356361 : undefined ;
357-
362+
358363 const computedStyles = getComputedStyle ( this ) ;
359364
360365 // Check if any source has cost configuration
You can’t perform that action at this time.
0 commit comments