mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-16 22:06:50 +00:00
Fix rendering of is_defined
example. (#21575)
This commit is contained in:
parent
f2119f6a05
commit
127c7707ac
@ -515,10 +515,14 @@ The `is_defined` filter allows to throw an error if a value or object is not def
|
||||
|
||||
Example using `is_defined` to parse a JSON payload:
|
||||
|
||||
{% raw %}
|
||||
|
||||
```text
|
||||
{{ value_json.val | is_defined }}
|
||||
```
|
||||
|
||||
{% endraw %}
|
||||
|
||||
This will throw an error `UndefinedError: 'value_json' is undefined` if the JSON payload has no `val` attribute.
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user