Using entity_picture_local for entity card and badge (#6489)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
Andrey Kupreychik 2020-07-30 21:33:08 +07:00 committed by GitHub
parent 3aa376e912
commit 07fceeab5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -81,7 +81,7 @@ export class HaStateLabelBadge extends LitElement {
? "" ? ""
: this.image : this.image
? this.image ? this.image
: state.attributes.entity_picture}" : state.attributes.entity_picture_local || state.attributes.entity_picture}"
.label="${this._computeLabel(domain, state, this._timerTimeRemaining)}" .label="${this._computeLabel(domain, state, this._timerTimeRemaining)}"
.description="${this.name ? this.name : computeStateName(state)}" .description="${this.name ? this.name : computeStateName(state)}"
></ha-label-badge> ></ha-label-badge>

View File

@ -73,10 +73,10 @@ export class StateBadge extends LitElement {
if (stateObj) { if (stateObj) {
// hide icon if we have entity picture // hide icon if we have entity picture
if ( if (
(stateObj.attributes.entity_picture && !this.overrideIcon) || ((stateObj.attributes.entity_picture_local || stateObj.attributes.entity_picture) && !this.overrideIcon) ||
this.overrideImage 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) { if (this.hass) {
imageUrl = this.hass.hassUrl(imageUrl); imageUrl = this.hass.hassUrl(imageUrl);
} }