mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-10 19:06:36 +00:00
border-radius fixes for state-badge (#23212)
This commit is contained in:
parent
6b230b6142
commit
d71b29d089
@ -113,7 +113,9 @@ export class StateBadge extends LitElement {
|
|||||||
|
|
||||||
this.icon = true;
|
this.icon = true;
|
||||||
|
|
||||||
if (stateObj && this.overrideImage === undefined) {
|
if (stateObj) {
|
||||||
|
const domain = computeDomain(stateObj.entity_id);
|
||||||
|
if (this.overrideImage === undefined) {
|
||||||
// hide icon if we have entity picture
|
// hide icon if we have entity picture
|
||||||
if (
|
if (
|
||||||
(stateObj.attributes.entity_picture_local ||
|
(stateObj.attributes.entity_picture_local ||
|
||||||
@ -126,17 +128,11 @@ export class StateBadge extends LitElement {
|
|||||||
if (this.hass) {
|
if (this.hass) {
|
||||||
imageUrl = this.hass.hassUrl(imageUrl);
|
imageUrl = this.hass.hassUrl(imageUrl);
|
||||||
}
|
}
|
||||||
const domain = computeDomain(stateObj.entity_id);
|
|
||||||
if (domain === "camera") {
|
if (domain === "camera") {
|
||||||
imageUrl = cameraUrlWithWidthHeight(imageUrl, 80, 80);
|
imageUrl = cameraUrlWithWidthHeight(imageUrl, 80, 80);
|
||||||
}
|
}
|
||||||
backgroundImage = `url(${imageUrl})`;
|
backgroundImage = `url(${imageUrl})`;
|
||||||
this.icon = false;
|
this.icon = false;
|
||||||
if (domain === "update") {
|
|
||||||
this.style.borderRadius = "0";
|
|
||||||
} else if (domain === "media_player") {
|
|
||||||
this.style.borderRadius = "8%";
|
|
||||||
}
|
|
||||||
} else if (this.color) {
|
} else if (this.color) {
|
||||||
// Externally provided overriding color wins over state color
|
// Externally provided overriding color wins over state color
|
||||||
iconStyle.color = this.color;
|
iconStyle.color = this.color;
|
||||||
@ -180,6 +176,13 @@ export class StateBadge extends LitElement {
|
|||||||
this.icon = false;
|
this.icon = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (domain === "update") {
|
||||||
|
this.style.borderRadius = "0";
|
||||||
|
} else if (domain === "media_player" || domain === "camera") {
|
||||||
|
this.style.borderRadius = "8%";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this._iconStyle = iconStyle;
|
this._iconStyle = iconStyle;
|
||||||
this.style.backgroundImage = backgroundImage;
|
this.style.backgroundImage = backgroundImage;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user