This commit is contained in:
Thomas Lovén 2019-02-04 16:16:28 +01:00
parent dcb79b0909
commit c806ca0b7d

View File

@ -31,6 +31,8 @@ class StateSwitch extends cardTools.litElement() {
} }
updateCard() { updateCard() {
const hass = this._hass;
if(!hass) return;
const lastCard = this.currentCard; const lastCard = this.currentCard;
if (this.config.entity === 'user') { if (this.config.entity === 'user') {
this.currentCard = this.cards[hass.user.name] this.currentCard = this.cards[hass.user.name]
@ -54,6 +56,7 @@ class StateSwitch extends cardTools.litElement() {
set hass(hass) { set hass(hass) {
if(!hass) return; if(!hass) return;
this._hass = hass;
this.updateCard(); this.updateCard();