You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you try to pass "None" as a string in templates (using {{ 'None' }} ) it returns the value None. No matter how you formate it according to docs from Jinja. I've tried {% raw %} None {% endraw %} and {{ 'None' }}.
This template return string "Something" when the X is false, and no value when true. It should return the string "None".
{% set x = true %}
{% if x == true %}
{{ 'None' }}
{% else %}
{{ 'Something' }}
{% endif %}
This is true even if you try to separate the None string into two parts. Like this:
{% set x = true %}
{% if x == true %}
{{ 'No' }}{{ 'ne' }}
{% else %}
{{ 'Some' }}{{ 'thing' }}
{% endif %}
it will return the string "Something" just ok, but the value none if X is true.
Also true for this case:
{% set x = true %}
{% if x == true %}
{{ 'No' }}ne
{% else %}
{{ 'Some' }}thing
{% endif %}
This also applies to the {% raw %}
{% set x = true %}
{% if x == true %}
{% raw %} None {% endraw %}
{% else %}
{% raw %} Something {% endraw %}
{% endif %}
This also returns the value none instead of the string "None".
But this returns string "{{ 'None' }}"
{% set x = true %}
{% if x == true %}
{% raw %} {{ 'None' }} {% endraw %}
{% else %}
{% raw %} {{ 'Something' }} {% endraw %}
{% endif %}
What is version of Home Assistant Core has the issue?
core-2021.5.4
What was the last working version of Home Assistant Core?
The problem
When you try to pass "None" as a string in templates (using
{{ 'None' }}
) it returns the value None. No matter how you formate it according to docs from Jinja. I've tried{% raw %} None {% endraw %}
and{{ 'None' }}
.This template return string "Something" when the X is false, and no value when true. It should return the string "None".
This is true even if you try to separate the None string into two parts. Like this:
it will return the string "Something" just ok, but the value none if X is true.
Also true for this case:
This also applies to the
{% raw %}
This also returns the value none instead of the string "None".
But this returns string "{{ 'None' }}"
What is version of Home Assistant Core has the issue?
core-2021.5.4
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
No response
Link to integration documentation on our website
https://www.home-assistant.io/docs/configuration/templating/
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: