Add Markdown To Do list example for Habitica (#26982)

This commit is contained in:
justinmbrock 2023-04-22 16:30:57 -04:00 committed by GitHub
parent a9fda83f37
commit efcbbf2cbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -145,3 +145,19 @@ Also an event `habitica_api_call_success` will be fired with the following data:
"id": "NEW_TASK_UUID"}
}
```
## Templating
`sensor.habitica_USER_dailys`, `sensor.habitica_USER_habits`, `sensor.habitica_USER_rewards`, and `sensor.habitica_Justin_todos` have state attributes listing the user's respective tasks. For example, you can see this information in **Developer Tools** -> **States** -> `sensor.habitica_USER_dailys` -> **Attributes**, or by adding a [Markdown card](/dashboards/markdown/) to a dashboard with the following code:
{% raw %}
```jinja
{% for key, value in states.sensor.habitica_USER_dailys.attributes.items() %}
{% if 'text' in value | string %}
{{ loop.index }}. {{ value.text }}
{% endif %}
{% endfor %}
```
{% endraw %}