From 793a7048715b55d179cc14ee76fb9d3b1802ffc7 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 2 Apr 2020 17:46:07 +0200 Subject: [PATCH] Update hui-media-player-entity-row.ts --- .../hui-media-player-entity-row.ts | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/panels/lovelace/entity-rows/hui-media-player-entity-row.ts b/src/panels/lovelace/entity-rows/hui-media-player-entity-row.ts index 792cdfef7c..e0b3180095 100644 --- a/src/panels/lovelace/entity-rows/hui-media-player-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-media-player-entity-row.ts @@ -84,6 +84,18 @@ class HuiMediaPlayerEntityRow extends LitElement implements LovelaceRow { const stateObj = this.hass.states[this._config.entity]; + if (!stateObj) { + return html` + ${this.hass.localize( + "ui.panel.lovelace.warning.entity_not_found", + "entity", + this._config.entity + )} + `; + } + const buttons = html` ${!this._narrow && supportsFeature(stateObj, SUPPORT_PREVIOUS_TRACK) ? html` @@ -112,18 +124,6 @@ class HuiMediaPlayerEntityRow extends LitElement implements LovelaceRow { : ""} `; - if (!stateObj) { - return html` - ${this.hass.localize( - "ui.panel.lovelace.warning.entity_not_found", - "entity", - this._config.entity - )} - `; - } - return html`