Templating and “magic” obsolescence explained

This blog entry is closed so I can’t comment on there. Stop requiring magic to enable templates

Can someone explain with an example the “before” and “after” of this change? Since the docs appear to be updated it’s hard to see what life was like before this new feature.

I believe what it means is that we no longer need to use “service_template” or “data_template” where they used to be required for HA to parse templates. Now just use the regular “service” and “data” options like you would without templates.

so instead of:

action:
  service_template: >
    {% if........%}
      light.turn_on
    {% else %}
      light.turn_off
    {% endif %}
  data_template:
    entity_id: >
      {% if....%}
        light.one
      {% else %}
        light.two
      {% endif %}

you can now just use:

action:
  service: >
    {% if........%}
      light.turn_on
    {% else %}
      light.turn_off
    {% endif %}
  data:
    entity_id: >
      {% if....%}
        light.one
      {% else %}
        light.two
      {% endif %}

At least that’s how I understand it.