diff --git a/src/components/entity/state-badge.ts b/src/components/entity/state-badge.ts index 211331ae98..080587ddc5 100644 --- a/src/components/entity/state-badge.ts +++ b/src/components/entity/state-badge.ts @@ -21,6 +21,7 @@ class StateBadge extends LitElement { public hass?: HomeAssistant; @property() public stateObj?: HassEntity; @property() public overrideIcon?: string; + @property() public overrideImage?: string; @query("ha-icon") private _icon!: HaIcon; protected render(): TemplateResult | void { @@ -55,8 +56,11 @@ class StateBadge extends LitElement { }; if (stateObj) { // hide icon if we have entity picture - if (stateObj.attributes.entity_picture && !this.overrideIcon) { - let imageUrl = stateObj.attributes.entity_picture; + if ( + (stateObj.attributes.entity_picture && !this.overrideIcon) || + this.overrideImage + ) { + let imageUrl = this.overrideImage || stateObj.attributes.entity_picture; if (this.hass) { imageUrl = this.hass.hassUrl(imageUrl); } diff --git a/src/panels/lovelace/cards/hui-glance-card.ts b/src/panels/lovelace/cards/hui-glance-card.ts index be7ee5d4f6..f33d00674a 100644 --- a/src/panels/lovelace/cards/hui-glance-card.ts +++ b/src/panels/lovelace/cards/hui-glance-card.ts @@ -202,6 +202,7 @@ export class HuiGlanceCard extends LitElement implements LovelaceCard { .hass=${this.hass} .stateObj=${stateObj} .overrideIcon=${entityConf.icon} + .overrideImage=${entityConf.image} > ` : ""} diff --git a/src/panels/lovelace/cards/types.ts b/src/panels/lovelace/cards/types.ts index ce1d21ad25..7c707f8af9 100644 --- a/src/panels/lovelace/cards/types.ts +++ b/src/panels/lovelace/cards/types.ts @@ -84,6 +84,7 @@ export interface ConfigEntity extends EntityConfig { export interface GlanceConfigEntity extends ConfigEntity { show_last_changed?: boolean; + image?: string; } export interface GlanceCardConfig extends LovelaceCardConfig {