Apologies if this is covered somewhere in the docs, but I think I have seen examples both ways. What is the difference between “>” and “>-” when templating? e.g.
# Angle bracket alone
value_template: >
{% if is_state_attr('remote.living_room_harmony', 'current_activity', 'PowerOff') %}
off
{% else %}
on
{% endif %}
versus
# Angle bracket with dash
value_template: >-
{% if is_state_attr('remote.living_room_harmony', 'current_activity', 'PowerOff') %}
off
{% else %}
on
{% endif %}
It’s just saying that if a string is quoted, how you escape a quote inside the string depends on which type of quote you used to quote the entire string. If you quote a string with single quote characters, then you don’t need to escape double quote characters inside the string, and you escape single quote characters by using two in a row (''). Whereas if you quote a string with double quote characters, then you don’t need to escape single quote characters inside the string, and you escape double quote characters by preceding them with a backslash (\").
No idea. Someone pointed out this link which has helped me in the past, so I thought I’d share it.