Skip to content

Commit

Permalink
Fix starting
Browse files Browse the repository at this point in the history
  • Loading branch information
Anonym-tsk committed Oct 15, 2019
1 parent be994ee commit d6f6280
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion dist/starline-card.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lovelace-starline-card",
"version": "1.0.6",
"version": "1.0.7",
"description": "Custom Lovelace Card for StarLine integration",
"scripts": {
"build": "node scripts/build.js"
Expand Down
3 changes: 2 additions & 1 deletion src/starline-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ class StarlineCard extends HTMLElement {
}

_setAlarmState() {
let states = this._hass.states[this._config.entities.security].attributes;
let entity = this._hass.states[this._config.entities.security],
states = entity ? entity.attributes : {};
for (let name in states) {
if (states.hasOwnProperty(name) && name !== 'friendly_name' && name !== 'icon') {
this.$container.classList.toggle('__alarm_' + name, states[name]);
Expand Down

0 comments on commit d6f6280

Please sign in to comment.