Skip to content

Commit 05dec26

Browse files
authored
Ensure platform template does not appear in repair (home-assistant#157486)
1 parent 25a6778 commit 05dec26

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

homeassistant/components/template/helpers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
CONF_ICON,
1818
CONF_ICON_TEMPLATE,
1919
CONF_NAME,
20+
CONF_PLATFORM,
2021
CONF_STATE,
2122
CONF_UNIQUE_ID,
2223
CONF_VALUE_TEMPLATE,
@@ -257,6 +258,7 @@ def create_legacy_template_issue(
257258
deprecation_list.append(issue_id)
258259

259260
try:
261+
config.pop(CONF_PLATFORM, None)
260262
modified_yaml = format_migration_config(config)
261263
yaml_config = yaml_util.dump({DOMAIN: [{domain: [modified_yaml]}]})
262264
# Format to show up properly in a numbered bullet on the repair.

tests/components/template/test_helpers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,7 @@ async def test_legacy_deprecation(
597597
assert issue.domain == "template"
598598
assert issue.severity == ir.IssueSeverity.WARNING
599599
assert issue.translation_placeholders["breadcrumb"] == breadcrumb
600+
assert "platform: template" not in issue.translation_placeholders["config"]
600601

601602

602603
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)