Skip to content

Commit

Permalink
Merge pull request #29 from roflcoopter/master
Browse files Browse the repository at this point in the history
Fix for when there is no upcoming media
  • Loading branch information
Ryan Meek authored Apr 19, 2019
2 parents 27af53c + 2aa94d7 commit 30cae35
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions upcoming-media-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ class UpcomingMediaCard extends HTMLElement {
}
service = service ? this.config.service : this.config.entity.slice(7,11);
const json = JSON.parse(hass.states[entity].attributes.data);
if (!json || !json.length) {
return
}
const view = this.config.image_style || 'poster';
const dateform = this.config.date || 'mmdd';
const icon = this.config.icon || json[0]['icon'];
Expand Down

0 comments on commit 30cae35

Please sign in to comment.