When no image occurs mark the image as undefined

This commit is contained in:
Zack Arnett 2020-02-17 11:51:05 -05:00
parent da1dd45169
commit be9ec50e3a

View File

@ -69,6 +69,8 @@ export class HuiMediaControlCard extends LitElement implements LovelaceCard {
} }
const stateObj = this.hass.states[this._config.entity] as MediaEntity; const stateObj = this.hass.states[this._config.entity] as MediaEntity;
console.log(stateObj);
if (!stateObj) { if (!stateObj) {
return html` return html`
<hui-warning <hui-warning
@ -216,6 +218,7 @@ export class HuiMediaControlCard extends LitElement implements LovelaceCard {
.entity_picture; .entity_picture;
if (!newImage || newImage === oldImage) { if (!newImage || newImage === oldImage) {
this._image = newImage;
return; return;
} }