Skip to content

Commit

Permalink
Merge pull request #16 from arniebarni/master
Browse files Browse the repository at this point in the history
Error handling in exlude zones
  • Loading branch information
malcolmrigg authored Jan 11, 2023
2 parents 11bfb5d + 0b68754 commit 76d6eb8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion weasley-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,10 @@ class WeasleyClockCard extends HTMLElement {
)
: this.lostState;

if (this.exclude.includes(this._hass.states["zone." + stateStr].attributes.friendly_name)) {
if (this.exclude.includes(stateStr) ||
(this._hass.states["zone." + stateStr] && this._hass.states["zone." + stateStr].attributes && this._hass.states["zone." + stateStr].attributes.friendly_name &&
this.exclude.includes(this._hass.states["zone." + stateStr].attributes.friendly_name))) {

stateStr = this.lostState;
}
const stateVelo = state && state.attributes ? (
Expand Down

0 comments on commit 76d6eb8

Please sign in to comment.