mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-24 21:37:21 +00:00
Fix icon overlay for person badges (#10201)
This commit is contained in:
parent
5be475ea17
commit
0056d75127
@ -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
|
||||
@ -81,12 +87,7 @@ 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,
|
||||
@ -94,7 +95,7 @@ export class HaStateLabelBadge extends LitElement {
|
||||
)}
|
||||
.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
|
||||
|
Loading…
x
Reference in New Issue
Block a user