mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 09:17:06 +00:00
link to default filter was incorrect (#18021)
This commit is contained in:
parent
c986148d68
commit
557101eda9
@ -51,7 +51,7 @@ script:
|
||||
There are a few very important rules to remember when adding templates to YAML:
|
||||
|
||||
1. You **must** surround single-line templates with double quotes (`"`) or single quotes (`'`).
|
||||
1. It is advised that you prepare for undefined variables by using `if ... is not none` or the [`default` filter](https://jinja.palletsprojects.com/en/latest/templates/#default), or both.
|
||||
1. It is advised that you prepare for undefined variables by using `if ... is not none` or the [`default` filter](https://jinja.palletsprojects.com/en/latest/templates/#jinja-filters.default), or both.
|
||||
1. It is advised that when comparing numbers, you convert the number(s) to a [`float`](https://jinja.palletsprojects.com/en/latest/templates/#float) or an [`int`](https://jinja.palletsprojects.com/en/latest/templates/#int) by using the respective [filter](https://jinja.palletsprojects.com/en/latest/templates/#list-of-builtin-filters).
|
||||
1. While the [`float`](https://jinja.palletsprojects.com/en/latest/templates/#float) and [`int`](https://jinja.palletsprojects.com/en/latest/templates/#int) filters do allow a default fallback value if the conversion is unsuccessful, they do not provide the ability to catch undefined variables.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user