Skip to content

Commit c4ac1eb

Browse files
committed
Allow filtering and sorting by last_changed and last_updated. Fix #44
1 parent b377a20 commit c4ac1eb

File tree

5 files changed

+67
-33
lines changed

5 files changed

+67
-33
lines changed

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ Filters have the following options, and will match any entity fulfilling **ALL**
6161
- `area:` Match entities in given area (e.g. `Kitchen`)
6262
- `device:` Match entities belonging to given device (e.g. `Thomas iPhone`)
6363
- `attributes:` Map of `attribute: value` pairs to match.
64+
- `last_changed:` Match minutes since last state change (most useful as a comparison, e.g. `last_changed: < 15`)
65+
- `last_updated:` Match minutes since last update
6466

6567
Special options:
6668
- `options:` Map of options to apply to entity when passed to card.
@@ -161,10 +163,10 @@ sort:
161163
numeric: <numeric>
162164
```
163165

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

auto-entities.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)