From 9dc05448350d3df14bfed51799d997db4bdb2a41 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Wed, 27 Jul 2022 14:41:00 +0200 Subject: [PATCH] Raise YAML removal issue for Bose SoundTouch (#75817) --- .../components/soundtouch/manifest.json | 1 + .../components/soundtouch/media_player.py | 18 ++++++++++++++---- .../components/soundtouch/strings.json | 6 ++++++ .../components/soundtouch/translations/en.json | 6 ++++++ 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/soundtouch/manifest.json b/homeassistant/components/soundtouch/manifest.json index c1c2abd3b80..4512f3a8f9b 100644 --- a/homeassistant/components/soundtouch/manifest.json +++ b/homeassistant/components/soundtouch/manifest.json @@ -4,6 +4,7 @@ "documentation": "https://www.home-assistant.io/integrations/soundtouch", "requirements": ["libsoundtouch==0.8"], "zeroconf": ["_soundtouch._tcp.local."], + "dependencies": ["repairs"], "codeowners": ["@kroimon"], "iot_class": "local_polling", "loggers": ["libsoundtouch"], diff --git a/homeassistant/components/soundtouch/media_player.py b/homeassistant/components/soundtouch/media_player.py index 2ed3dd9beea..74d89404d27 100644 --- a/homeassistant/components/soundtouch/media_player.py +++ b/homeassistant/components/soundtouch/media_player.py @@ -19,6 +19,7 @@ from homeassistant.components.media_player import ( from homeassistant.components.media_player.browse_media import ( async_process_play_media_url, ) +from homeassistant.components.repairs import IssueSeverity, async_create_issue from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry from homeassistant.const import ( CONF_HOST, @@ -70,11 +71,20 @@ async def async_setup_platform( discovery_info: DiscoveryInfoType | None = None, ) -> None: """Set up the Bose SoundTouch platform.""" + 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( - "Configuration of the Bose SoundTouch platform in YAML is deprecated and will be " - "removed in a future release; Your existing configuration " - "has been imported into the UI automatically and can be safely removed " - "from your configuration.yaml file" + "Configuration of the Bose SoundTouch 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" ) hass.async_create_task( hass.config_entries.flow.async_init( diff --git a/homeassistant/components/soundtouch/strings.json b/homeassistant/components/soundtouch/strings.json index 7ebcd4c5285..6a8896c8f56 100644 --- a/homeassistant/components/soundtouch/strings.json +++ b/homeassistant/components/soundtouch/strings.json @@ -17,5 +17,11 @@ "abort": { "already_configured": "[%key:common::config_flow::abort::already_configured_device%]" } + }, + "issues": { + "deprecated_yaml": { + "title": "The Bose SoundTouch YAML configuration is being removed", + "description": "Configuring Bose SoundTouch using YAML is being removed.\n\nYour existing YAML configuration has been imported into the UI automatically.\n\nRemove the Bose SoundTouch YAML configuration from your configuration.yaml file and restart Home Assistant to fix this issue." + } } } diff --git a/homeassistant/components/soundtouch/translations/en.json b/homeassistant/components/soundtouch/translations/en.json index 2e025d3f187..28eb32b7d43 100644 --- a/homeassistant/components/soundtouch/translations/en.json +++ b/homeassistant/components/soundtouch/translations/en.json @@ -17,5 +17,11 @@ "title": "Confirm adding Bose SoundTouch device" } } + }, + "issues": { + "deprecated_yaml": { + "description": "Configuring Bose SoundTouch using YAML is being removed.\n\nYour existing YAML configuration has been imported into the UI automatically.\n\nRemove the Bose SoundTouch YAML configuration from your configuration.yaml file and restart Home Assistant to fix this issue.", + "title": "The Bose SoundTouch YAML configuration is being removed" + } } } \ No newline at end of file