Update template deprecation to be more explicit (#157965)

This commit is contained in:
Petro31
2025-12-04 12:34:01 -05:00
committed by GitHub
parent a35af9097b
commit 2eeac5f9c9
2 changed files with 2 additions and 3 deletions

View File

@@ -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": "<filename>",
},
)

View File

@@ -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"
}
},