File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ export class PowerDistributionCard extends LitElement {
109109 _config . entities . forEach ( ( item , index ) => {
110110 if ( ! item . entity ) return ;
111111 const hass_uom = this . _state ( { entity : item . entity , attribute : 'unit_of_measurement' } ) as string ;
112- ! item . unit_of_measurement ? ( this . _config . entities [ index ] . unit_of_measurement = hass_uom || 'W' ) : undefined ;
112+ if ( ! item . unit_of_measurement ) this . _config . entities [ index ] . unit_of_measurement = hass_uom || 'W' ;
113113 } ) ;
114114 // Applying the same to bars
115115 if ( _config . center . type == 'bars' ) {
@@ -247,7 +247,8 @@ export class PowerDistributionCard extends LitElement {
247247 case 'none' :
248248 break ;
249249 case 'card' :
250- this . _card ? center_panel . push ( this . _card ) : console . warn ( 'NO CARD' ) ;
250+ if ( this . _card ) center_panel . push ( this . _card ) ;
251+ else console . warn ( 'NO CARD' ) ;
251252 break ;
252253 case 'bars' :
253254 center_panel . push ( this . _render_bars ( consumption , production ) ) ;
@@ -536,6 +537,6 @@ export class PowerDistributionCard extends LitElement {
536537 if ( cardElToReplace . parentElement ) {
537538 cardElToReplace . parentElement . replaceChild ( newCardEl , cardElToReplace ) ;
538539 }
539- this . _card === cardElToReplace ? ( this . _card = newCardEl ) : undefined ;
540+ if ( this . _card === cardElToReplace ) this . _card = newCardEl ;
540541 }
541542}
You can’t perform that action at this time.
0 commit comments