Ensure platform template does not appear in repair (#157486)

This commit is contained in:
Petro31
2025-12-01 19:25:27 +00:00
committed by Franck Nijhof
parent 5948ff2e31
commit 236f7cd22c
2 changed files with 3 additions and 0 deletions
@@ -17,6 +17,7 @@ from homeassistant.const import (
CONF_ICON,
CONF_ICON_TEMPLATE,
CONF_NAME,
CONF_PLATFORM,
CONF_STATE,
CONF_UNIQUE_ID,
CONF_VALUE_TEMPLATE,
@@ -257,6 +258,7 @@ def create_legacy_template_issue(
deprecation_list.append(issue_id)
try:
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.
@@ -597,6 +597,7 @@ async def test_legacy_deprecation(
assert issue.domain == "template"
assert issue.severity == ir.IssueSeverity.WARNING
assert issue.translation_placeholders["breadcrumb"] == breadcrumb
assert "platform: template" not in issue.translation_placeholders["config"]
@pytest.mark.parametrize(