Skip to content

Commit

Permalink
Fix icon overlay for person badges (#10201)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus authored and bramkragten committed Oct 9, 2021
1 parent 5be475e commit 0056d75
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/components/entity/ha-state-label-badge.ts
Expand Up @@ -73,6 +73,12 @@ export class HaStateLabelBadge extends LitElement {

const value = this._computeValue(domain, entityState);
const icon = this.icon ? this.icon : this._computeIcon(domain, entityState);
const image = this.icon
? ""
: this.image
? this.image
: entityState.attributes.entity_picture_local ||
entityState.attributes.entity_picture;

return html`
<ha-label-badge
Expand All @@ -81,20 +87,15 @@ export class HaStateLabelBadge extends LitElement {
"has-unit_of_measurement":
"unit_of_measurement" in entityState.attributes,
})}
.image=${this.icon
? ""
: this.image
? this.image
: entityState.attributes.entity_picture_local ||
entityState.attributes.entity_picture}
.image=${image}
.label=${this._computeLabel(
domain,
entityState,
this._timerTimeRemaining
)}
.description=${this.name ?? computeStateName(entityState)}
>
${icon ? html`<ha-icon .icon=${icon}></ha-icon>` : ""}
${!image && icon ? html`<ha-icon .icon=${icon}></ha-icon>` : ""}
${value && (this.icon || !this.image)
? html`<span class=${value && value.length > 4 ? "big" : ""}
>${value}</span
Expand Down

0 comments on commit 0056d75

Please sign in to comment.