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 @@ -123,11 +123,15 @@ class HuiEnergyDistrubutionCard
123123 }
124124 if (
125125 this . _data &&
126- energySourcesByType ( this . _data . prefs ) . gas ?. some (
127- ( source ) =>
128- this . hass . entities [ source . stat_energy_from ] ?. display_precision !==
129- oldHass . entities [ source . stat_energy_from ] ?. display_precision
130- )
126+ energySourcesByType ( this . _data . prefs ) . gas ?. some ( ( source ) => {
127+ const statId = source . stat_energy_from ;
128+ return (
129+ this . hass . entities [ statId ] ?. display_precision !==
130+ oldHass . entities [ statId ] ?. display_precision ||
131+ this . hass . states [ statId ] ?. attributes . unit_of_measurement !==
132+ oldHass . states [ statId ] ?. attributes . unit_of_measurement
133+ ) ;
134+ } )
131135 ) {
132136 return true ;
133137 }
@@ -463,8 +467,8 @@ class HuiEnergyDistrubutionCard
463467 this . hass ,
464468 gasUsage ,
465469 this . _data . gasUnit ,
466- undefined ,
467- gasDisplayPrecision
470+ undefined ,
471+ gasDisplayPrecision
468472 ) }
469473 </ div>
470474 <svg width= "80" height = "30">
You can’t perform that action at this time.
0 commit comments