mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-18 23:06:40 +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 value = this._computeValue(domain, entityState);
|
||||||
const icon = this.icon ? this.icon : this._computeIcon(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`
|
return html`
|
||||||
<ha-label-badge
|
<ha-label-badge
|
||||||
@ -81,12 +87,7 @@ export class HaStateLabelBadge extends LitElement {
|
|||||||
"has-unit_of_measurement":
|
"has-unit_of_measurement":
|
||||||
"unit_of_measurement" in entityState.attributes,
|
"unit_of_measurement" in entityState.attributes,
|
||||||
})}
|
})}
|
||||||
.image=${this.icon
|
.image=${image}
|
||||||
? ""
|
|
||||||
: this.image
|
|
||||||
? this.image
|
|
||||||
: entityState.attributes.entity_picture_local ||
|
|
||||||
entityState.attributes.entity_picture}
|
|
||||||
.label=${this._computeLabel(
|
.label=${this._computeLabel(
|
||||||
domain,
|
domain,
|
||||||
entityState,
|
entityState,
|
||||||
@ -94,7 +95,7 @@ export class HaStateLabelBadge extends LitElement {
|
|||||||
)}
|
)}
|
||||||
.description=${this.name ?? computeStateName(entityState)}
|
.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)
|
${value && (this.icon || !this.image)
|
||||||
? html`<span class=${value && value.length > 4 ? "big" : ""}
|
? html`<span class=${value && value.length > 4 ? "big" : ""}
|
||||||
>${value}</span
|
>${value}</span
|
||||||
|
Loading…
x
Reference in New Issue
Block a user