From 4ea532b3ea1a17e658a2b618eccc711cb394dd2c Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Tue, 26 Jul 2022 01:11:07 +0200 Subject: [PATCH] Add issue to repairs for removed Steam YAML configuration (#75737) --- .../components/steam_online/__init__.py | 18 ++++++++++++++++++ .../components/steam_online/manifest.json | 1 + .../components/steam_online/strings.json | 6 ++++++ .../steam_online/translations/en.json | 6 ++++++ 4 files changed, 31 insertions(+) diff --git a/homeassistant/components/steam_online/__init__.py b/homeassistant/components/steam_online/__init__.py index eae81dd8435..c422269a277 100644 --- a/homeassistant/components/steam_online/__init__.py +++ b/homeassistant/components/steam_online/__init__.py @@ -1,11 +1,13 @@ """The Steam integration.""" from __future__ import annotations +from homeassistant.components.repairs import IssueSeverity, async_create_issue from homeassistant.config_entries import ConfigEntry from homeassistant.const import Platform from homeassistant.core import HomeAssistant from homeassistant.helpers.device_registry import DeviceEntryType from homeassistant.helpers.entity import DeviceInfo +from homeassistant.helpers.typing import ConfigType from homeassistant.helpers.update_coordinator import CoordinatorEntity from .const import DEFAULT_NAME, DOMAIN @@ -14,6 +16,22 @@ from .coordinator import SteamDataUpdateCoordinator PLATFORMS = [Platform.SENSOR] +async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: + """Set up the Steam integration.""" + if DOMAIN in config: + async_create_issue( + hass, + DOMAIN, + "removed_yaml", + breaks_in_ha_version="2022.8.0", + is_fixable=False, + severity=IssueSeverity.WARNING, + translation_key="removed_yaml", + ) + + return True + + async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Set up Steam from a config entry.""" coordinator = SteamDataUpdateCoordinator(hass) diff --git a/homeassistant/components/steam_online/manifest.json b/homeassistant/components/steam_online/manifest.json index f8aba1aee07..f2e3a35bbe7 100644 --- a/homeassistant/components/steam_online/manifest.json +++ b/homeassistant/components/steam_online/manifest.json @@ -4,6 +4,7 @@ "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/steam_online", "requirements": ["steamodd==4.21"], + "dependencies": ["repairs"], "codeowners": ["@tkdrob"], "iot_class": "cloud_polling", "loggers": ["steam"] diff --git a/homeassistant/components/steam_online/strings.json b/homeassistant/components/steam_online/strings.json index 1b431795ea4..63dc7cce22a 100644 --- a/homeassistant/components/steam_online/strings.json +++ b/homeassistant/components/steam_online/strings.json @@ -35,5 +35,11 @@ "error": { "unauthorized": "Friends list restricted: Please refer to the documentation on how to see all other friends" } + }, + "issues": { + "removed_yaml": { + "title": "The Steam YAML configuration has been removed", + "description": "Configuring Steam using YAML has been removed.\n\nYour existing YAML configuration is not used by Home Assistant.\n\nRemove the YAML configuration from your configuration.yaml file and restart Home Assistant to fix this issue." + } } } diff --git a/homeassistant/components/steam_online/translations/en.json b/homeassistant/components/steam_online/translations/en.json index 7226c5ee177..2a7bef3f683 100644 --- a/homeassistant/components/steam_online/translations/en.json +++ b/homeassistant/components/steam_online/translations/en.json @@ -24,6 +24,12 @@ } } }, + "issues": { + "removed_yaml": { + "description": "Configuring Steam using YAML has been removed.\n\nYour existing YAML configuration is not used by Home Assistant.\n\nRemove the YAML configuration from your configuration.yaml file and restart Home Assistant to fix this issue.", + "title": "The Steam YAML configuration has been removed" + } + }, "options": { "error": { "unauthorized": "Friends list restricted: Please refer to the documentation on how to see all other friends"