Skip to content

Commit 2a116a2

Browse files
authored
Fix missing template key in deprecation repair (home-assistant#158033)
1 parent f189e3b commit 2a116a2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

homeassistant/components/template/helpers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,9 @@ def create_legacy_template_issue(
269269
try:
270270
config.pop(CONF_PLATFORM, None)
271271
modified_yaml = format_migration_config(config)
272-
yaml_config = yaml_util.dump({DOMAIN: [{domain: [modified_yaml]}]})
272+
yaml_config = (
273+
f"```\n{yaml_util.dump({DOMAIN: [{domain: [modified_yaml]}]})}\n```"
274+
)
273275
except RecursionError:
274276
yaml_config = f"{DOMAIN}:\n - {domain}: - ..."
275277

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#### 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",
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{config}\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)