From 314778cb50b5107bc18da04778ef9c8818352994 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Wed, 27 Jul 2022 14:17:22 +0200 Subject: [PATCH] Raise YAML removal issue for Anthem A/V Receivers (#75816) --- homeassistant/components/anthemav/manifest.json | 1 + homeassistant/components/anthemav/media_player.py | 15 ++++++++++++++- homeassistant/components/anthemav/strings.json | 6 ++++++ .../components/anthemav/translations/en.json | 6 ++++++ 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/anthemav/manifest.json b/homeassistant/components/anthemav/manifest.json index 33fe565ad03..27db9df32a3 100644 --- a/homeassistant/components/anthemav/manifest.json +++ b/homeassistant/components/anthemav/manifest.json @@ -3,6 +3,7 @@ "name": "Anthem A/V Receivers", "documentation": "https://www.home-assistant.io/integrations/anthemav", "requirements": ["anthemav==1.3.2"], + "dependencies": ["repairs"], "codeowners": ["@hyralex"], "config_flow": true, "iot_class": "local_push", diff --git a/homeassistant/components/anthemav/media_player.py b/homeassistant/components/anthemav/media_player.py index 93fdedef054..3c3a363a6db 100644 --- a/homeassistant/components/anthemav/media_player.py +++ b/homeassistant/components/anthemav/media_player.py @@ -12,6 +12,7 @@ from homeassistant.components.media_player import ( MediaPlayerEntity, MediaPlayerEntityFeature, ) +from homeassistant.components.repairs import IssueSeverity, async_create_issue from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry from homeassistant.const import ( CONF_HOST, @@ -55,8 +56,20 @@ async def async_setup_platform( discovery_info: DiscoveryInfoType | None = None, ) -> None: """Set up our socket to the AVR.""" + async_create_issue( + hass, + DOMAIN, + "deprecated_yaml", + breaks_in_ha_version="2022.10.0", + is_fixable=False, + severity=IssueSeverity.WARNING, + translation_key="deprecated_yaml", + ) _LOGGER.warning( - "AnthemAV configuration is deprecated and has been automatically imported. Please remove the integration from your configuration file" + "Configuration of the Anthem A/V Receivers integration in YAML is " + "deprecated and will be removed in Home Assistant 2022.10; Your " + "existing configuration has been imported into the UI automatically " + "and can be safely removed from your configuration.yaml file" ) await hass.config_entries.flow.async_init( DOMAIN, diff --git a/homeassistant/components/anthemav/strings.json b/homeassistant/components/anthemav/strings.json index 1f1dd0ec75b..b4e777c4de1 100644 --- a/homeassistant/components/anthemav/strings.json +++ b/homeassistant/components/anthemav/strings.json @@ -15,5 +15,11 @@ "abort": { "already_configured": "[%key:common::config_flow::abort::already_configured_device%]" } + }, + "issues": { + "deprecated_yaml": { + "title": "The Anthem A/V Receivers YAML configuration is being removed", + "description": "Configuring Anthem A/V Receivers using YAML is being removed.\n\nYour existing YAML configuration has been imported into the UI automatically.\n\nRemove the Anthem A/V Receivers YAML configuration from your configuration.yaml file and restart Home Assistant to fix this issue." + } } } diff --git a/homeassistant/components/anthemav/translations/en.json b/homeassistant/components/anthemav/translations/en.json index 9177d5a6e70..af4c83eb2a8 100644 --- a/homeassistant/components/anthemav/translations/en.json +++ b/homeassistant/components/anthemav/translations/en.json @@ -15,5 +15,11 @@ } } } + }, + "issues": { + "deprecated_yaml": { + "description": "Configuring Anthem A/V Receivers using YAML is being removed.\n\nYour existing YAML configuration has been imported into the UI automatically.\n\nRemove the Anthem A/V Receivers YAML configuration from your configuration.yaml file and restart Home Assistant to fix this issue.", + "title": "The Anthem A/V Receivers YAML configuration is being removed" + } } } \ No newline at end of file