mirror of
https://github.com/house-of-abbey/GarminHomeAssistant.git
synced 2025-05-03 06:02:27 +00:00
Update Templates.md
Jinja2 explained
This commit is contained in:
@ -2,10 +2,14 @@
|
|||||||
|
|
||||||
# Templates
|
# Templates
|
||||||
|
|
||||||
In order to provide the most functionality possible the content of the menu item comes from a user-defined template (i.e. you generate your own text). This allows you to do some pretty cool things. It also makes the config a bit more complicated. This page will help you understand how to use templates.
|
In order to provide the most functionality possible the content of the menu item comes from a user-defined template (i.e. you generate your own text). This allows you to do some pretty cool things. It also makes the configuration a bit more complicated. This page will help you understand how to use templates.
|
||||||
|
|
||||||
- In this file anything between `<` and `>` is a placeholder. Replace it with the appropriate value.
|
- In this file anything between `<` and `>` is a placeholder. Replace it with the appropriate value.
|
||||||
- Anything between `{{` and `}}` is a template. Templates are used to dynamically insert values into the content. For more info see [the docs](https://www.home-assistant.io/docs/configuration/templating/).
|
- [Jinga2](https://palletsprojects.com/p/jinja/) syntax is used by Home Assistant [Templates](https://www.home-assistant.io/docs/configuration/templating/). Templates are used to dynamically insert values into the content. The syntax includes:
|
||||||
|
|
||||||
|
- `{%` ... `%}` for Statements
|
||||||
|
- `{{` ... `}}` for Expressions to print to the template output
|
||||||
|
- `{#` ... `#}` for Comments not included in the template output
|
||||||
|
|
||||||
## States
|
## States
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user