mirror of
https://github.com/sascha-hemi/hacs_waste_collection_schedule.git
synced 2026-03-21 04:06:03 +01:00
Merge pull request #40 from mampfes/add_days_to
add daysTo to device state attributes
This commit is contained in:
14
README.md
14
README.md
@@ -221,6 +221,7 @@ sensor:
|
||||
leadtime: LEADTIME
|
||||
value_template: VALUE_TEMPLATE
|
||||
date_template: DATE_TEMPLATE
|
||||
add_days_to: ADD_DAYS_TO
|
||||
types:
|
||||
- Waste Type 1
|
||||
- Waste Type 2
|
||||
@@ -288,6 +289,12 @@ Template string used to format collection dates within the more-info popup.
|
||||
|
||||
See [Template Variables](#template-variables) for a list of available variables.
|
||||
|
||||
**add_days_to**
|
||||
|
||||
*(boolean) (optional, default: ```False```)*
|
||||
|
||||
Adds an attribute with the label `daysTo` and the number of days to the next collection to the entity state of the source.
|
||||
|
||||
**types**
|
||||
|
||||
*(list of strings) (optional)*
|
||||
@@ -507,6 +514,13 @@ entity: sensor.garbage
|
||||
type: 'custom:garbage-collection-card'
|
||||
```
|
||||
|
||||
### 13. How can I sort waste type specific entities?
|
||||
|
||||
Prerequisites: You already have dedicated sensors per waste type and want to show the sensor with the next collection in a Lovelace card.
|
||||
|
||||
Add `add_days_to: True` to the configuration of all sensors you want to sort. This will add the attribute `daysTo` which can be used by e.g. [auto-entities](https://github.com/thomasloven/lovelace-auto-entities) to sort entities by day of next collection.
|
||||
|
||||
|
||||
## How to add new sources
|
||||
|
||||
1. Create a new source in folder `custom_components/waste_collection_schedule/package/source` with the lower case url of your service provider (e.g. `abc_com.py` for `http://www.abc.com`).
|
||||
|
||||
Reference in New Issue
Block a user