Skip to content

Commit

Permalink
Allow filtering and sorting by last_changed and last_updated. Fix #44
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasloven committed Dec 9, 2019
1 parent b377a20 commit 9a03e25
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 33 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ Filters have the following options, and will match any entity fulfilling **ALL**
- `area:` Match entities in given area (e.g. `Kitchen`)
- `device:` Match entities belonging to given device (e.g. `Thomas iPhone`)
- `attributes:` Map of `attribute: value` pairs to match.
- `last_changed:` Match minutes since last state change (most useful as a comparison, e.g. `last_changed: < 15`)
- `last_updated:` Match minutes since last update

Special options:
- `options:` Map of options to apply to entity when passed to card.
Expand Down Expand Up @@ -161,10 +163,10 @@ sort:
numeric: <numeric>
```

- `method:` **Required** One of `domain`, `entity_id`, `name`, `state` or `attribute`
- `method:` **Required** One of `domain`, `entity_id`, `name`, `state`, `attribute`, `last_changed` or `last_updated`
- `reverse:` Set to `true` to reverse the order. Default: `false`.
- `ignore_case:` Set to `true` to make the sort case-insensitive. Default: `false`.
- `numeric:` Set to `true` to sort by numeric value. Default: `false`.
- `numeric:` Set to `true` to sort by numeric value. Default: `false` except for `last_changed` and `last_updated` sorting methods.
- `attribute:` Attribute to sort by if `method: attribute`. Can be an *object attribute* as above (e.g. `attribute: rgb_color:2`)
- `first` and `count` can be used to only display `<count>` entities, starting with the `<first>` (starts with 0).

Expand Down
4 changes: 2 additions & 2 deletions auto-entities.js

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

Loading

0 comments on commit 9a03e25

Please sign in to comment.