From bd04c1d9f96f975ca2eabd10fec0e0cb50748daf Mon Sep 17 00:00:00 2001 From: Martin Hjelmare Date: Mon, 5 Dec 2022 16:54:36 +0100 Subject: [PATCH] Deprecate the Xbox Live integration (#83339) --- homeassistant/components/xbox_live/sensor.py | 14 ++++++++++++++ homeassistant/components/xbox_live/strings.json | 8 ++++++++ .../components/xbox_live/translations/en.json | 8 ++++++++ 3 files changed, 30 insertions(+) create mode 100644 homeassistant/components/xbox_live/strings.json create mode 100644 homeassistant/components/xbox_live/translations/en.json diff --git a/homeassistant/components/xbox_live/sensor.py b/homeassistant/components/xbox_live/sensor.py index 07adcbeb5cc..f75dbe6ba4e 100644 --- a/homeassistant/components/xbox_live/sensor.py +++ b/homeassistant/components/xbox_live/sensor.py @@ -13,6 +13,7 @@ from homeassistant.core import HomeAssistant, callback import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.event import async_track_time_interval +from homeassistant.helpers.issue_registry import IssueSeverity, create_issue from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType _LOGGER = logging.getLogger(__name__) @@ -36,6 +37,19 @@ def setup_platform( discovery_info: DiscoveryInfoType | None = None, ) -> None: """Set up the Xbox platform.""" + create_issue( + hass, + "xbox_live", + "pending_removal", + breaks_in_ha_version="2023.2.0", + is_fixable=False, + severity=IssueSeverity.WARNING, + translation_key="pending_removal", + ) + _LOGGER.warning( + "The Xbox Live integration is deprecated " + "and will be removed in Home Assistant 2023.2" + ) api = Client(api_key=config[CONF_API_KEY]) entities = [] diff --git a/homeassistant/components/xbox_live/strings.json b/homeassistant/components/xbox_live/strings.json new file mode 100644 index 00000000000..0f73f851bd7 --- /dev/null +++ b/homeassistant/components/xbox_live/strings.json @@ -0,0 +1,8 @@ +{ + "issues": { + "pending_removal": { + "title": "The Xbox Live integration is being removed", + "description": "The Xbox Live integration is pending removal from Home Assistant and will no longer be available as of Home Assistant 2023.2.\n\nThe integration is being removed, because it is only useful for the legacy device Xbox 360 and the upstream API now requires a paid subscription. Newer consoles are supported by the Xbox integration for free.\n\nRemove the Xbox Live YAML configuration from your configuration.yaml file and restart Home Assistant to fix this issue." + } + } +} diff --git a/homeassistant/components/xbox_live/translations/en.json b/homeassistant/components/xbox_live/translations/en.json new file mode 100644 index 00000000000..cb2ca622a22 --- /dev/null +++ b/homeassistant/components/xbox_live/translations/en.json @@ -0,0 +1,8 @@ +{ + "issues": { + "pending_removal": { + "description": "The Xbox Live integration is pending removal from Home Assistant and will no longer be available as of Home Assistant 2023.2.\n\nThe integration is being removed, because it is only useful for the legacy device Xbox 360 and the upstream API now requires a paid subscription. Newer consoles are supported by the Xbox integration for free.\n\nRemove the Xbox Live YAML configuration from your configuration.yaml file and restart Home Assistant to fix this issue.", + "title": "The Xbox Live integration is being removed" + } + } +} \ No newline at end of file