Skip to content

Commit 2eeac5f

Browse files
authored
Update template deprecation to be more explicit (home-assistant#157965)
1 parent a35af90 commit 2eeac5f

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

homeassistant/components/template/helpers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,6 @@ def create_legacy_template_issue(
270270
config.pop(CONF_PLATFORM, None)
271271
modified_yaml = format_migration_config(config)
272272
yaml_config = yaml_util.dump({DOMAIN: [{domain: [modified_yaml]}]})
273-
# Format to show up properly in a numbered bullet on the repair.
274-
yaml_config = " ```\n " + yaml_config.replace("\n", "\n ") + "```"
275273
except RecursionError:
276274
yaml_config = f"{DOMAIN}:\n - {domain}: - ..."
277275

@@ -287,6 +285,7 @@ def create_legacy_template_issue(
287285
"domain": domain,
288286
"breadcrumb": breadcrumb,
289287
"config": yaml_config,
288+
"filename": "<filename>",
290289
},
291290
)
292291

homeassistant/components/template/strings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@
529529
"title": "Deprecated battery level option in {entity_name}"
530530
},
531531
"deprecated_legacy_templates": {
532-
"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.",
532+
"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",
533533
"title": "Legacy {domain} template deprecation"
534534
}
535535
},

0 commit comments

Comments
 (0)