diff --git a/homeassistant/components/template/helpers.py b/homeassistant/components/template/helpers.py index fea955923e0..1f476181e71 100644 --- a/homeassistant/components/template/helpers.py +++ b/homeassistant/components/template/helpers.py @@ -270,8 +270,6 @@ def create_legacy_template_issue( config.pop(CONF_PLATFORM, None) modified_yaml = format_migration_config(config) yaml_config = yaml_util.dump({DOMAIN: [{domain: [modified_yaml]}]}) - # Format to show up properly in a numbered bullet on the repair. - yaml_config = " ```\n " + yaml_config.replace("\n", "\n ") + "```" except RecursionError: yaml_config = f"{DOMAIN}:\n - {domain}: - ..." @@ -287,6 +285,7 @@ def create_legacy_template_issue( "domain": domain, "breadcrumb": breadcrumb, "config": yaml_config, + "filename": "", }, ) diff --git a/homeassistant/components/template/strings.json b/homeassistant/components/template/strings.json index f3fd4e419c2..90ff404cb2f 100644 --- a/homeassistant/components/template/strings.json +++ b/homeassistant/components/template/strings.json @@ -529,7 +529,7 @@ "title": "Deprecated battery level option in {entity_name}" }, "deprecated_legacy_templates": { - "description": "The legacy `platform: template` syntax for `{domain}` is being removed. Please migrate `{breadcrumb}` to the modern template syntax.\n\n1. Remove existing template definition.\n2. Add new template definition:\n{config}\n3. Restart Home Assistant or reload template entities.", + "description": "The legacy `platform: template` syntax for `{domain}` is being removed. Please migrate `{breadcrumb}` to the modern template syntax.\n#### Step 1 - Remove legacy configuration\nRemove the `{breadcrumb}` template definition from the `configuration.yaml` `{domain}:` section.\n\n**Note:** If you are using `{domain}: !include {filename}.yaml` in `configuration.yaml`, remove the {domain} definition from the included `{filename}.yaml`.\n#### Step 2 - Add the modern configuration\nAdd new template definition inside `configuration.yaml`:\n\n```{config}```\n\n**Note:** If there are any existing `template:` sections in your configuration, make sure to omit the `template:` line from the yaml above. There can only be 1 `template:` section in `configuration.yaml`. Also, ensure the indentation is aligned with the existing entities within the `template:` section.\n#### Step 3 - Restart Home Assistant or reload template entities", "title": "Legacy {domain} template deprecation" } },