Skip to content

Commit

Permalink
Display name/header above additional entity icons (closes #41)
Browse files Browse the repository at this point in the history
  • Loading branch information
benct committed Mar 7, 2020
1 parent 612ad9f commit 73bca82
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions multiple-entity-row.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,14 @@
renderEntity(entity) {
return entity ? html`
<div class="entity" @click="${entity.onClick}">
${entity.toggle
? html`<span>${entity.name}</span><div><ha-entity-toggle .stateObj="${entity.stateObj}" .hass="${this._hass}"></ha-entity-toggle></div>`
<span>${entity.name}</span>
<div>
${entity.toggle
? html`<ha-entity-toggle .stateObj="${entity.stateObj}" .hass="${this._hass}"></ha-entity-toggle>`
: entity.icon
? html`<state-badge class="icon-small" .stateObj="${entity.stateObj}" .overrideIcon="${entity.icon}" .stateColor="${entity.state_color}"></state-badge>`
: html`<span>${entity.name}</span><div>${entity.value}</div>`}
: html`${entity.value}`}
</div>
</div>` : null;
}

Expand Down Expand Up @@ -173,7 +176,7 @@

return {
stateObj: stateObj,
name: this.entityName(config.name, stateObj),
name: entity ? this.entityName(config.name, stateObj) : (config.name || null),
value: config.attribute !== undefined
? this.entityAttribute(stateObj, config.attribute, config.unit)
: this.entityStateValue(stateObj, config.unit),
Expand Down

0 comments on commit 73bca82

Please sign in to comment.