Skip to content

Commit

Permalink
Show error Icon when a entity is unknown
Browse files Browse the repository at this point in the history
  • Loading branch information
queimadus committed Nov 17, 2021
1 parent bd26017 commit 5a9bda4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cover-icon-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class CoverIconElement extends HTMLElement {

setImage(hass) {
if (hass && this._config) {
let image = CoverIconElement.dataImage4(this._config.color, this._config.opacity);
let image = CoverIconElement.dataImageError(this._config.color);

if (this._config.entity) {
const stateObj = hass.states[this._config.entity];
Expand All @@ -30,6 +30,8 @@ class CoverIconElement extends HTMLElement {
image = CoverIconElement.dataImage2(this._config.color, this._config.opacity);
} else if (position >= this._config.breakpoints[0]) {
image = CoverIconElement.dataImage3(this._config.color, this._config.opacity);
} else {
image = CoverIconElement.dataImage4(this._config.color, this._config.opacity);
}
}
}
Expand Down

0 comments on commit 5a9bda4

Please sign in to comment.