From 07fceeab5a42a2c8cf3e430e4bb6f363e5b8b419 Mon Sep 17 00:00:00 2001 From: Andrey Kupreychik Date: Thu, 30 Jul 2020 21:33:08 +0700 Subject: [PATCH] Using entity_picture_local for entity card and badge (#6489) Co-authored-by: Bram Kragten --- src/components/entity/ha-state-label-badge.ts | 2 +- src/components/entity/state-badge.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/entity/ha-state-label-badge.ts b/src/components/entity/ha-state-label-badge.ts index 2fb7b688bd..b38009042f 100644 --- a/src/components/entity/ha-state-label-badge.ts +++ b/src/components/entity/ha-state-label-badge.ts @@ -81,7 +81,7 @@ export class HaStateLabelBadge extends LitElement { ? "" : this.image ? this.image - : state.attributes.entity_picture}" + : state.attributes.entity_picture_local || state.attributes.entity_picture}" .label="${this._computeLabel(domain, state, this._timerTimeRemaining)}" .description="${this.name ? this.name : computeStateName(state)}" > diff --git a/src/components/entity/state-badge.ts b/src/components/entity/state-badge.ts index d621d6c590..be8b055f14 100644 --- a/src/components/entity/state-badge.ts +++ b/src/components/entity/state-badge.ts @@ -73,10 +73,10 @@ export class StateBadge extends LitElement { if (stateObj) { // hide icon if we have entity picture if ( - (stateObj.attributes.entity_picture && !this.overrideIcon) || + ((stateObj.attributes.entity_picture_local || stateObj.attributes.entity_picture) && !this.overrideIcon) || this.overrideImage ) { - let imageUrl = this.overrideImage || stateObj.attributes.entity_picture; + let imageUrl = this.overrideImage || stateObj.attributes.entity_picture_local || stateObj.attributes.entity_picture; if (this.hass) { imageUrl = this.hass.hassUrl(imageUrl); }