From 08a5f6347487be6238bdf16b51daba041daa1052 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Mon, 10 Jul 2023 13:06:52 +0200 Subject: [PATCH] Add deprecated_yaml issue to the homeassistant integration (#95980) * Add deprecated_yaml issue to the homeassistant integration * Update test * Update homeassistant/components/homeassistant/strings.json Co-authored-by: G Johansson * Include DOMAIN in issue_id * Update test --------- Co-authored-by: G Johansson --- homeassistant/components/brottsplatskartan/sensor.py | 11 ++++++++--- .../components/brottsplatskartan/strings.json | 6 ------ .../components/dwd_weather_warnings/sensor.py | 11 ++++++++--- .../components/dwd_weather_warnings/strings.json | 6 ------ homeassistant/components/dynalite/config_flow.py | 10 ++++++++-- homeassistant/components/dynalite/strings.json | 6 ------ .../components/geo_json_events/geo_location.py | 11 ++++++++--- homeassistant/components/geo_json_events/strings.json | 6 ------ homeassistant/components/homeassistant/strings.json | 4 ++++ homeassistant/components/lastfm/sensor.py | 11 ++++++++--- homeassistant/components/lastfm/strings.json | 6 ------ homeassistant/components/mystrom/light.py | 11 ++++++++--- homeassistant/components/mystrom/strings.json | 6 ------ homeassistant/components/mystrom/switch.py | 11 ++++++++--- homeassistant/components/qbittorrent/sensor.py | 11 ++++++++--- homeassistant/components/qbittorrent/strings.json | 6 ------ homeassistant/components/qnap/sensor.py | 11 ++++++++--- homeassistant/components/qnap/strings.json | 6 ------ homeassistant/components/snapcast/media_player.py | 11 ++++++++--- homeassistant/components/snapcast/strings.json | 6 ------ homeassistant/components/workday/binary_sensor.py | 11 ++++++++--- homeassistant/components/workday/strings.json | 6 ------ homeassistant/components/zodiac/__init__.py | 11 ++++++++--- homeassistant/components/zodiac/strings.json | 6 ------ tests/components/dynalite/test_config_flow.py | 7 +++++-- 25 files changed, 105 insertions(+), 103 deletions(-) diff --git a/homeassistant/components/brottsplatskartan/sensor.py b/homeassistant/components/brottsplatskartan/sensor.py index 5512bcd1176..add558ff48b 100644 --- a/homeassistant/components/brottsplatskartan/sensor.py +++ b/homeassistant/components/brottsplatskartan/sensor.py @@ -13,7 +13,7 @@ from homeassistant.components.sensor import ( ) from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry from homeassistant.const import CONF_LATITUDE, CONF_LONGITUDE, CONF_NAME -from homeassistant.core import HomeAssistant +from homeassistant.core import DOMAIN as HOMEASSISTANT_DOMAIN, HomeAssistant import homeassistant.helpers.config_validation as cv from homeassistant.helpers.device_registry import DeviceEntryType from homeassistant.helpers.entity import DeviceInfo @@ -45,12 +45,17 @@ async def async_setup_platform( async_create_issue( hass, - DOMAIN, - "deprecated_yaml", + HOMEASSISTANT_DOMAIN, + f"deprecated_yaml_{DOMAIN}", breaks_in_ha_version="2023.11.0", is_fixable=False, + issue_domain=DOMAIN, severity=IssueSeverity.WARNING, translation_key="deprecated_yaml", + translation_placeholders={ + "domain": DOMAIN, + "integration_title": "Brottsplatskartan", + }, ) hass.async_create_task( diff --git a/homeassistant/components/brottsplatskartan/strings.json b/homeassistant/components/brottsplatskartan/strings.json index 8d9677a0af4..f10120f7884 100644 --- a/homeassistant/components/brottsplatskartan/strings.json +++ b/homeassistant/components/brottsplatskartan/strings.json @@ -16,12 +16,6 @@ } } }, - "issues": { - "deprecated_yaml": { - "title": "The Brottsplatskartan YAML configuration is being removed", - "description": "Configuring Brottsplatskartan using YAML is being removed.\n\nYour existing YAML configuration has been imported into the UI automatically.\n\nRemove the Brottsplatskartan YAML configuration from your configuration.yaml file and restart Home Assistant to fix this issue." - } - }, "selector": { "areas": { "options": { diff --git a/homeassistant/components/dwd_weather_warnings/sensor.py b/homeassistant/components/dwd_weather_warnings/sensor.py index f44d736b426..62bb4af7930 100644 --- a/homeassistant/components/dwd_weather_warnings/sensor.py +++ b/homeassistant/components/dwd_weather_warnings/sensor.py @@ -22,7 +22,7 @@ from homeassistant.components.sensor import ( ) from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry from homeassistant.const import CONF_MONITORED_CONDITIONS, CONF_NAME -from homeassistant.core import HomeAssistant +from homeassistant.core import DOMAIN as HOMEASSISTANT_DOMAIN, HomeAssistant import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.issue_registry import IssueSeverity, async_create_issue @@ -89,12 +89,17 @@ async def async_setup_platform( # Show issue as long as the YAML configuration exists. async_create_issue( hass, - DOMAIN, - "deprecated_yaml", + HOMEASSISTANT_DOMAIN, + f"deprecated_yaml_{DOMAIN}", breaks_in_ha_version="2023.12.0", is_fixable=False, + issue_domain=DOMAIN, severity=IssueSeverity.WARNING, translation_key="deprecated_yaml", + translation_placeholders={ + "domain": DOMAIN, + "integration_title": "Deutscher Wetterdienst (DWD) Weather Warnings", + }, ) hass.async_create_task( diff --git a/homeassistant/components/dwd_weather_warnings/strings.json b/homeassistant/components/dwd_weather_warnings/strings.json index c5c954a9f8e..60e53f90dbd 100644 --- a/homeassistant/components/dwd_weather_warnings/strings.json +++ b/homeassistant/components/dwd_weather_warnings/strings.json @@ -15,11 +15,5 @@ "already_configured": "Warncell ID / name is already configured.", "invalid_identifier": "[%key:component::dwd_weather_warnings::config::error::invalid_identifier%]" } - }, - "issues": { - "deprecated_yaml": { - "title": "The Deutscher Wetterdienst (DWD) Weather Warnings YAML configuration is being removed", - "description": "Configuring Deutscher Wetterdienst (DWD) Weather Warnings using YAML is being removed.\n\nYour existing YAML configuration has been imported into the UI automatically.\n\nRemove the Deutscher Wetterdienst (DWD) Weather Warnings YAML configuration from your configuration.yaml file and restart Home Assistant to fix this issue." - } } } diff --git a/homeassistant/components/dynalite/config_flow.py b/homeassistant/components/dynalite/config_flow.py index 946d4ac653d..8438307c698 100644 --- a/homeassistant/components/dynalite/config_flow.py +++ b/homeassistant/components/dynalite/config_flow.py @@ -7,6 +7,7 @@ import voluptuous as vol from homeassistant import config_entries from homeassistant.const import CONF_HOST, CONF_PORT +from homeassistant.core import DOMAIN as HOMEASSISTANT_DOMAIN from homeassistant.data_entry_flow import FlowResult from homeassistant.helpers import config_validation as cv from homeassistant.helpers.issue_registry import IssueSeverity, async_create_issue @@ -31,12 +32,17 @@ class DynaliteFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): # Raise an issue that this is deprecated and has been imported async_create_issue( self.hass, - DOMAIN, - "deprecated_yaml", + HOMEASSISTANT_DOMAIN, + f"deprecated_yaml_{DOMAIN}", is_fixable=False, is_persistent=False, + issue_domain=DOMAIN, severity=IssueSeverity.WARNING, translation_key="deprecated_yaml", + translation_placeholders={ + "domain": DOMAIN, + "integration_title": "Dynalite", + }, ) host = import_info[CONF_HOST] diff --git a/homeassistant/components/dynalite/strings.json b/homeassistant/components/dynalite/strings.json index 1d78108f909..8ad7deacd92 100644 --- a/homeassistant/components/dynalite/strings.json +++ b/homeassistant/components/dynalite/strings.json @@ -14,11 +14,5 @@ "already_configured": "[%key:common::config_flow::abort::already_configured_device%]", "cannot_connect": "[%key:common::config_flow::error::cannot_connect%]" } - }, - "issues": { - "deprecated_yaml": { - "title": "The Dynalite YAML configuration is being removed", - "description": "Configuring Dynalite using YAML is being removed.\n\nYour existing YAML configuration has been imported into the UI automatically.\n\nRemove the Dynalite YAML configuration from your configuration.yaml file and restart Home Assistant to fix this issue." - } } } diff --git a/homeassistant/components/geo_json_events/geo_location.py b/homeassistant/components/geo_json_events/geo_location.py index b922d98f25e..c0192a0037d 100644 --- a/homeassistant/components/geo_json_events/geo_location.py +++ b/homeassistant/components/geo_json_events/geo_location.py @@ -17,7 +17,7 @@ from homeassistant.const import ( CONF_URL, UnitOfLength, ) -from homeassistant.core import HomeAssistant, callback +from homeassistant.core import DOMAIN as HOMEASSISTANT_DOMAIN, HomeAssistant, callback import homeassistant.helpers.config_validation as cv from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helpers.entity_platform import AddEntitiesCallback @@ -81,12 +81,17 @@ async def async_setup_platform( """Set up the GeoJSON Events platform.""" async_create_issue( hass, - DOMAIN, - "deprecated_yaml", + HOMEASSISTANT_DOMAIN, + f"deprecated_yaml_{DOMAIN}", breaks_in_ha_version="2023.12.0", is_fixable=False, + issue_domain=DOMAIN, severity=IssueSeverity.WARNING, translation_key="deprecated_yaml", + translation_placeholders={ + "domain": DOMAIN, + "integration_title": "GeoJSON feed", + }, ) hass.async_create_task( hass.config_entries.flow.async_init( diff --git a/homeassistant/components/geo_json_events/strings.json b/homeassistant/components/geo_json_events/strings.json index e50369d6e74..1a2409b1cd2 100644 --- a/homeassistant/components/geo_json_events/strings.json +++ b/homeassistant/components/geo_json_events/strings.json @@ -12,11 +12,5 @@ "abort": { "already_configured": "[%key:common::config_flow::abort::already_configured_service%]" } - }, - "issues": { - "deprecated_yaml": { - "title": "The GeoJSON feed YAML configuration is being removed", - "description": "Configuring a GeoJSON feed using YAML is being removed.\n\nYour existing YAML configuration has been imported into the UI automatically.\n\nRemove the GeoJSON feed YAML configuration from your configuration.yaml file and restart Home Assistant to fix this issue." - } } } diff --git a/homeassistant/components/homeassistant/strings.json b/homeassistant/components/homeassistant/strings.json index edb26c3622e..89da615cf31 100644 --- a/homeassistant/components/homeassistant/strings.json +++ b/homeassistant/components/homeassistant/strings.json @@ -4,6 +4,10 @@ "title": "The country has not been configured", "description": "No country has been configured, please update the configuration by clicking on the \"learn more\" button below." }, + "deprecated_yaml": { + "title": "The {integration_title} YAML configuration is being removed", + "description": "Configuring {integration_title} using YAML is being removed.\n\nYour existing YAML configuration has been imported into the UI automatically.\n\nRemove the `{domain}` configuration from your configuration.yaml file and restart Home Assistant to fix this issue." + }, "historic_currency": { "title": "The configured currency is no longer in use", "description": "The currency {currency} is no longer in use, please reconfigure the currency configuration." diff --git a/homeassistant/components/lastfm/sensor.py b/homeassistant/components/lastfm/sensor.py index b4776b19c50..c51868394de 100644 --- a/homeassistant/components/lastfm/sensor.py +++ b/homeassistant/components/lastfm/sensor.py @@ -9,7 +9,7 @@ import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry from homeassistant.const import CONF_API_KEY -from homeassistant.core import HomeAssistant +from homeassistant.core import DOMAIN as HOMEASSISTANT_DOMAIN, HomeAssistant import homeassistant.helpers.config_validation as cv from homeassistant.helpers.device_registry import DeviceEntryType from homeassistant.helpers.entity import DeviceInfo @@ -51,12 +51,17 @@ async def async_setup_platform( async_create_issue( hass, - DOMAIN, - "deprecated_yaml", + HOMEASSISTANT_DOMAIN, + f"deprecated_yaml_{DOMAIN}", breaks_in_ha_version="2023.12.0", is_fixable=False, + issue_domain=DOMAIN, severity=IssueSeverity.WARNING, translation_key="deprecated_yaml", + translation_placeholders={ + "domain": DOMAIN, + "integration_title": "LastFM", + }, ) hass.async_create_task( diff --git a/homeassistant/components/lastfm/strings.json b/homeassistant/components/lastfm/strings.json index f9156bed658..fe9a4b6453f 100644 --- a/homeassistant/components/lastfm/strings.json +++ b/homeassistant/components/lastfm/strings.json @@ -35,11 +35,5 @@ "invalid_account": "Invalid username", "unknown": "[%key:common::config_flow::error::unknown%]" } - }, - "issues": { - "deprecated_yaml": { - "title": "The LastFM YAML configuration is being removed", - "description": "Configuring LastFM using YAML is being removed.\n\nYour existing YAML configuration has been imported into the UI automatically.\n\nRemove the LastFM YAML configuration from your configuration.yaml file and restart Home Assistant to fix this issue." - } } } diff --git a/homeassistant/components/mystrom/light.py b/homeassistant/components/mystrom/light.py index 14badde17d2..8c4998fa45e 100644 --- a/homeassistant/components/mystrom/light.py +++ b/homeassistant/components/mystrom/light.py @@ -18,7 +18,7 @@ from homeassistant.components.light import ( ) from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry from homeassistant.const import CONF_HOST, CONF_MAC, CONF_NAME -from homeassistant.core import HomeAssistant +from homeassistant.core import DOMAIN as HOMEASSISTANT_DOMAIN, HomeAssistant import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import DeviceInfo from homeassistant.helpers.entity_platform import AddEntitiesCallback @@ -61,12 +61,17 @@ async def async_setup_platform( """Set up the myStrom light integration.""" async_create_issue( hass, - DOMAIN, - "deprecated_yaml", + HOMEASSISTANT_DOMAIN, + f"deprecated_yaml_{DOMAIN}", breaks_in_ha_version="2023.12.0", is_fixable=False, + issue_domain=DOMAIN, severity=IssueSeverity.WARNING, translation_key="deprecated_yaml", + translation_placeholders={ + "domain": DOMAIN, + "integration_title": "myStrom", + }, ) hass.async_create_task( hass.config_entries.flow.async_init( diff --git a/homeassistant/components/mystrom/strings.json b/homeassistant/components/mystrom/strings.json index 259501e1486..a485a58f5a6 100644 --- a/homeassistant/components/mystrom/strings.json +++ b/homeassistant/components/mystrom/strings.json @@ -14,11 +14,5 @@ "abort": { "already_configured": "[%key:common::config_flow::abort::already_configured_device%]" } - }, - "issues": { - "deprecated_yaml": { - "title": "The myStrom YAML configuration is being removed", - "description": "Configuring myStrom using YAML is being removed.\n\nYour existing YAML configuration has been imported into the UI automatically.\n\nRemove the myStrom YAML configuration from your configuration.yaml file and restart Home Assistant to fix this issue." - } } } diff --git a/homeassistant/components/mystrom/switch.py b/homeassistant/components/mystrom/switch.py index 8e89bb5f151..7180862758c 100644 --- a/homeassistant/components/mystrom/switch.py +++ b/homeassistant/components/mystrom/switch.py @@ -10,7 +10,7 @@ import voluptuous as vol from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchEntity from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry from homeassistant.const import CONF_HOST, CONF_NAME -from homeassistant.core import HomeAssistant +from homeassistant.core import DOMAIN as HOMEASSISTANT_DOMAIN, HomeAssistant import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import DeviceInfo from homeassistant.helpers.entity_platform import AddEntitiesCallback @@ -48,12 +48,17 @@ async def async_setup_platform( """Set up the myStrom switch/plug integration.""" async_create_issue( hass, - DOMAIN, - "deprecated_yaml", + HOMEASSISTANT_DOMAIN, + f"deprecated_yaml_{DOMAIN}", breaks_in_ha_version="2023.12.0", is_fixable=False, + issue_domain=DOMAIN, severity=IssueSeverity.WARNING, translation_key="deprecated_yaml", + translation_placeholders={ + "domain": DOMAIN, + "integration_title": "myStrom", + }, ) hass.async_create_task( hass.config_entries.flow.async_init( diff --git a/homeassistant/components/qbittorrent/sensor.py b/homeassistant/components/qbittorrent/sensor.py index 15a634cf7a9..0d5dc160a11 100644 --- a/homeassistant/components/qbittorrent/sensor.py +++ b/homeassistant/components/qbittorrent/sensor.py @@ -23,7 +23,7 @@ from homeassistant.const import ( STATE_IDLE, UnitOfDataRate, ) -from homeassistant.core import HomeAssistant +from homeassistant.core import DOMAIN as HOMEASSISTANT_DOMAIN, HomeAssistant from homeassistant.helpers import issue_registry as ir import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity_platform import AddEntitiesCallback @@ -84,12 +84,17 @@ async def async_setup_platform( ) ir.async_create_issue( hass, - DOMAIN, - "deprecated_yaml", + HOMEASSISTANT_DOMAIN, + f"deprecated_yaml_{DOMAIN}", breaks_in_ha_version="2023.11.0", is_fixable=False, + issue_domain=DOMAIN, severity=ir.IssueSeverity.WARNING, translation_key="deprecated_yaml", + translation_placeholders={ + "domain": DOMAIN, + "integration_title": "qBittorrent", + }, ) diff --git a/homeassistant/components/qbittorrent/strings.json b/homeassistant/components/qbittorrent/strings.json index 24d1885a917..66c9430911e 100644 --- a/homeassistant/components/qbittorrent/strings.json +++ b/homeassistant/components/qbittorrent/strings.json @@ -17,11 +17,5 @@ "abort": { "already_configured": "[%key:common::config_flow::abort::already_configured_device%]" } - }, - "issues": { - "deprecated_yaml": { - "title": "The qBittorrent YAML configuration is being removed", - "description": "Configuring qBittorrent using YAML is being removed.\n\nYour existing YAML configuration has been imported into the UI automatically.\n\nRemove the qBittorrent YAML configuration from your configuration.yaml file and restart Home Assistant to fix this issue." - } } } diff --git a/homeassistant/components/qnap/sensor.py b/homeassistant/components/qnap/sensor.py index 6d214b63e2e..c26b72f9295 100644 --- a/homeassistant/components/qnap/sensor.py +++ b/homeassistant/components/qnap/sensor.py @@ -28,7 +28,7 @@ from homeassistant.const import ( UnitOfInformation, UnitOfTemperature, ) -from homeassistant.core import HomeAssistant +from homeassistant.core import DOMAIN as HOMEASSISTANT_DOMAIN, HomeAssistant from homeassistant.exceptions import PlatformNotReady import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import DeviceInfo @@ -235,12 +235,17 @@ async def async_setup_platform( async_create_issue( hass, - DOMAIN, - "deprecated_yaml", + HOMEASSISTANT_DOMAIN, + f"deprecated_yaml_{DOMAIN}", breaks_in_ha_version="2023.12.0", is_fixable=False, + issue_domain=DOMAIN, severity=IssueSeverity.WARNING, translation_key="deprecated_yaml", + translation_placeholders={ + "domain": DOMAIN, + "integration_title": "QNAP", + }, ) hass.async_create_task( diff --git a/homeassistant/components/qnap/strings.json b/homeassistant/components/qnap/strings.json index 36946b81c0c..26ca5dedd34 100644 --- a/homeassistant/components/qnap/strings.json +++ b/homeassistant/components/qnap/strings.json @@ -19,11 +19,5 @@ "invalid_auth": "Bad authentication", "unknown": "Unknown error" } - }, - "issues": { - "deprecated_yaml": { - "title": "The QNAP YAML configuration is being removed", - "description": "Configuring QNAP using YAML is being removed.\n\nYour existing YAML configuration has been imported into the UI automatically.\n\nRemove the QNAP YAML configuration from your configuration.yaml file and restart Home Assistant to fix this issue." - } } } diff --git a/homeassistant/components/snapcast/media_player.py b/homeassistant/components/snapcast/media_player.py index 096e3829bc7..9dadae2e3e2 100644 --- a/homeassistant/components/snapcast/media_player.py +++ b/homeassistant/components/snapcast/media_player.py @@ -14,7 +14,7 @@ from homeassistant.components.media_player import ( ) from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry from homeassistant.const import CONF_HOST, CONF_PORT -from homeassistant.core import HomeAssistant +from homeassistant.core import DOMAIN as HOMEASSISTANT_DOMAIN, HomeAssistant from homeassistant.helpers import config_validation as cv, entity_platform from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.issue_registry import IssueSeverity, async_create_issue @@ -102,12 +102,17 @@ async def async_setup_platform( """Set up the Snapcast platform.""" async_create_issue( hass, - DOMAIN, - "deprecated_yaml", + HOMEASSISTANT_DOMAIN, + f"deprecated_yaml_{DOMAIN}", breaks_in_ha_version="2023.11.0", is_fixable=False, + issue_domain=DOMAIN, severity=IssueSeverity.WARNING, translation_key="deprecated_yaml", + translation_placeholders={ + "domain": DOMAIN, + "integration_title": "Snapcast", + }, ) config[CONF_PORT] = config.get(CONF_PORT, CONTROL_PORT) diff --git a/homeassistant/components/snapcast/strings.json b/homeassistant/components/snapcast/strings.json index 0087b70d820..766bca63495 100644 --- a/homeassistant/components/snapcast/strings.json +++ b/homeassistant/components/snapcast/strings.json @@ -17,11 +17,5 @@ "cannot_connect": "[%key:common::config_flow::error::cannot_connect%]", "invalid_host": "[%key:common::config_flow::error::invalid_host%]" } - }, - "issues": { - "deprecated_yaml": { - "title": "The Snapcast YAML configuration is being removed", - "description": "Configuring Snapcast using YAML is being removed.\n\nYour existing YAML configuration has been imported into the UI automatically.\n\nRemove the Snapcast YAML configuration from your configuration.yaml file and restart Home Assistant to fix this issue." - } } } diff --git a/homeassistant/components/workday/binary_sensor.py b/homeassistant/components/workday/binary_sensor.py index 0814958ad27..c80608ab1c2 100644 --- a/homeassistant/components/workday/binary_sensor.py +++ b/homeassistant/components/workday/binary_sensor.py @@ -14,7 +14,7 @@ from homeassistant.components.binary_sensor import ( ) from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry from homeassistant.const import CONF_NAME -from homeassistant.core import HomeAssistant +from homeassistant.core import DOMAIN as HOMEASSISTANT_DOMAIN, HomeAssistant import homeassistant.helpers.config_validation as cv from homeassistant.helpers.device_registry import DeviceEntryType from homeassistant.helpers.entity import DeviceInfo @@ -90,12 +90,17 @@ async def async_setup_platform( """Set up the Workday sensor.""" async_create_issue( hass, - DOMAIN, - "deprecated_yaml", + HOMEASSISTANT_DOMAIN, + f"deprecated_yaml_{DOMAIN}", breaks_in_ha_version="2023.11.0", is_fixable=False, + issue_domain=DOMAIN, severity=IssueSeverity.WARNING, translation_key="deprecated_yaml", + translation_placeholders={ + "domain": DOMAIN, + "integration_title": "Workday", + }, ) hass.async_create_task( diff --git a/homeassistant/components/workday/strings.json b/homeassistant/components/workday/strings.json index fcebc7638c6..6ea8348812d 100644 --- a/homeassistant/components/workday/strings.json +++ b/homeassistant/components/workday/strings.json @@ -65,12 +65,6 @@ "already_configured": "Service with this configuration already exist" } }, - "issues": { - "deprecated_yaml": { - "title": "The Workday YAML configuration is being removed", - "description": "Configuring Workday using YAML is being removed.\n\nYour existing YAML configuration has been imported into the UI automatically.\n\nRemove the Workday YAML configuration from your configuration.yaml file and restart Home Assistant to fix this issue." - } - }, "selector": { "province": { "options": { diff --git a/homeassistant/components/zodiac/__init__.py b/homeassistant/components/zodiac/__init__.py index 892bcac5bf9..81d5b5bdc21 100644 --- a/homeassistant/components/zodiac/__init__.py +++ b/homeassistant/components/zodiac/__init__.py @@ -3,7 +3,7 @@ import voluptuous as vol from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry from homeassistant.const import Platform -from homeassistant.core import HomeAssistant +from homeassistant.core import DOMAIN as HOMEASSISTANT_DOMAIN, HomeAssistant from homeassistant.helpers.issue_registry import IssueSeverity, async_create_issue from homeassistant.helpers.typing import ConfigType @@ -20,12 +20,17 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: async_create_issue( hass, - DOMAIN, - "deprecated_yaml", + HOMEASSISTANT_DOMAIN, + f"deprecated_yaml_{DOMAIN}", breaks_in_ha_version="2024.1.0", is_fixable=False, + issue_domain=DOMAIN, severity=IssueSeverity.WARNING, translation_key="deprecated_yaml", + translation_placeholders={ + "domain": DOMAIN, + "integration_title": "Zodiac", + }, ) hass.async_create_task( diff --git a/homeassistant/components/zodiac/strings.json b/homeassistant/components/zodiac/strings.json index 8cf0e22237e..f8ae42d30a8 100644 --- a/homeassistant/components/zodiac/strings.json +++ b/homeassistant/components/zodiac/strings.json @@ -28,11 +28,5 @@ } } } - }, - "issues": { - "deprecated_yaml": { - "title": "The Zodiac YAML configuration is being removed", - "description": "Configuring Zodiac using YAML is being removed.\n\nYour existing YAML configuration has been imported into the UI automatically.\n\nRemove the Zodiac YAML configuration from your configuration.yaml file and restart Home Assistant to fix this issue." - } } } diff --git a/tests/components/dynalite/test_config_flow.py b/tests/components/dynalite/test_config_flow.py index d0bd335decc..f337c7c3e74 100644 --- a/tests/components/dynalite/test_config_flow.py +++ b/tests/components/dynalite/test_config_flow.py @@ -6,7 +6,7 @@ import pytest from homeassistant import config_entries from homeassistant.components import dynalite from homeassistant.const import CONF_PORT -from homeassistant.core import HomeAssistant +from homeassistant.core import DOMAIN as HOMEASSISTANT_DOMAIN, HomeAssistant from homeassistant.helpers.issue_registry import ( IssueSeverity, async_get as async_get_issue_registry, @@ -52,8 +52,11 @@ async def test_flow( assert result["result"].state == exp_result if exp_reason: assert result["reason"] == exp_reason - issue = registry.async_get_issue(dynalite.DOMAIN, "deprecated_yaml") + issue = registry.async_get_issue( + HOMEASSISTANT_DOMAIN, f"deprecated_yaml_{dynalite.DOMAIN}" + ) assert issue is not None + assert issue.issue_domain == dynalite.DOMAIN assert issue.severity == IssueSeverity.WARNING