mirror of
https://github.com/home-assistant/core.git
synced 2026-09-05 02:25:07 -05:00
Ensure platform template does not appear in repair (#157486)
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user