Fix default card

This commit is contained in:
Thomas Lovén 2018-11-24 23:44:29 +01:00
parent 9973e66c3d
commit 2b02f22084

View File

@ -29,7 +29,7 @@ class StateSwitch extends Polymer.Element{
this.currentCard = this.cards[hass.user.name] || this.cards[this.config.default]; this.currentCard = this.cards[hass.user.name] || this.cards[this.config.default];
} else { } else {
let state = hass.states[this.config.entity]; let state = hass.states[this.config.entity];
this.currentCard = (state)?this.cards[state.state]:null || this.cards[this.config.default]; this.currentCard = ((state)?this.cards[state.state]:null) || this.cards[this.config.default];
} }
if(this.currentCard != lastCard) { if(this.currentCard != lastCard) {