From efcbbf2cbee484bfc768595f2cdc56685521d0a3 Mon Sep 17 00:00:00 2001 From: justinmbrock <6379307+justinmbrock@users.noreply.github.com> Date: Sat, 22 Apr 2023 16:30:57 -0400 Subject: [PATCH] Add Markdown To Do list example for Habitica (#26982) --- source/_integrations/habitica.markdown | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/source/_integrations/habitica.markdown b/source/_integrations/habitica.markdown index e23be034ffb..dba8531039a 100644 --- a/source/_integrations/habitica.markdown +++ b/source/_integrations/habitica.markdown @@ -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 %}