Prettier Fixes

This commit is contained in:
Zack Arnett 2018-10-17 11:11:29 -04:00
parent 698beedaa2
commit 35941a58a5

View File

@ -62,7 +62,8 @@ class HuiGlanceCard extends HassLocalizeLitMixin(LitElement)
} }
} }
const columnWidth = config.entities.length > 4 ? "20%" : `${100 / config.entities.length}%` const columnWidth =
config.entities.length > 4 ? "20%" : `${100 / config.entities.length}%`;
this.style.setProperty( this.style.setProperty(
"--glance-column-width", "--glance-column-width",
@ -98,10 +99,10 @@ class HuiGlanceCard extends HassLocalizeLitMixin(LitElement)
<ha-card .header="${title}"> <ha-card .header="${title}">
<div class="entities ${classMap({ "no-header": !title })}"> <div class="entities ${classMap({ "no-header": !title })}">
${repeat<EntityConfig>( ${repeat<EntityConfig>(
entities, entities,
(entityConf) => entityConf.entity, (entityConf) => entityConf.entity,
(entityConf) => this.renderEntity(entityConf) (entityConf) => this.renderEntity(entityConf)
)} )}
</div> </div>
</ha-card> </ha-card>
`; `;
@ -160,23 +161,23 @@ class HuiGlanceCard extends HassLocalizeLitMixin(LitElement)
@click="${this.handleClick}" @click="${this.handleClick}"
> >
${ ${
this.config!.show_name !== false this.config!.show_name !== false
? html`<div class="name">${ ? html`<div class="name">${
"name" in entityConf "name" in entityConf
? entityConf.name ? entityConf.name
: computeStateName(stateObj) : computeStateName(stateObj)
}</div>` }</div>`
: "" : ""
} }
<state-badge <state-badge
.stateObj="${stateObj}" .stateObj="${stateObj}"
.overrideIcon="${entityConf.icon}" .overrideIcon="${entityConf.icon}"
></state-badge> ></state-badge>
${ ${
this.config!.show_state !== false this.config!.show_state !== false
? html`<div>${computeStateDisplay(this.localize, stateObj)}</div>` ? html`<div>${computeStateDisplay(this.localize, stateObj)}</div>`
: "" : ""
} }
</div> </div>
`; `;
} }