Skip to content

Commit

Permalink
Merge pull request #11 from fsteccanella/feed_attribute
Browse files Browse the repository at this point in the history
Added a parameter to specify which attribute contains the feed
  • Loading branch information
iantrich committed Jul 10, 2019
2 parents 1d97873 + 598f364 commit 91e62c9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -31,6 +31,7 @@ From left to right: [feedparser](https://github.com/custom-components/sensor.fee
| ---- | ---- | ------- | -----------
| type | string | **Required** | `custom:list-card`
| entity | string | **Required** | The entity_id of the entity you want to show.
| feed_attribute | string | **Optional** | Attribute containing the feed
| title | string | **Optional** | Add a custom title to the card.
| row_limit | number | **Optional** | Limit the number of rows to display.
| columns | object | **Optional** | List of columns to display.
Expand Down
2 changes: 1 addition & 1 deletion list-card.js
Expand Up @@ -86,7 +86,7 @@ class ListCard extends HTMLElement {
const card = root.lastChild;

if (hass.states[config.entity]) {
const feed = hass.states[config.entity].attributes;
const feed = config.feed_attribute ? hass.states[config.entity].attributes[config.feed_attribute] : hass.states[config.entity].attributes;
const columns = config.columns;
this.style.display = 'block';
const rowLimit = config.row_limit ? config.row_limit : Object.keys(feed).length;
Expand Down

0 comments on commit 91e62c9

Please sign in to comment.