From c806ca0b7ddde22f9686e131a8f82643e30f4e30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Lov=C3=A9n?= Date: Mon, 4 Feb 2019 16:16:28 +0100 Subject: [PATCH] bugfix --- state-switch.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/state-switch.js b/state-switch.js index 55221bb..8dc8bd5 100644 --- a/state-switch.js +++ b/state-switch.js @@ -31,6 +31,8 @@ class StateSwitch extends cardTools.litElement() { } updateCard() { + const hass = this._hass; + if(!hass) return; const lastCard = this.currentCard; if (this.config.entity === 'user') { this.currentCard = this.cards[hass.user.name] @@ -54,6 +56,7 @@ class StateSwitch extends cardTools.litElement() { set hass(hass) { if(!hass) return; + this._hass = hass; this.updateCard();