Skip to content

Commit c9beb01

Browse files
committed
Linter Adjustments
1 parent 66333ee commit c9beb01

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/power-distribution-card.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)