Add issue to repairs for removed Spotify YAML configuration (#75736)

* Add issue to repairs for removed Spotify YAML configuration

* Tweak message
This commit is contained in:
Franck Nijhof 2022-07-26 01:09:59 +02:00 committed by GitHub
parent e87c2b9e25
commit c7ddc595ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 1 deletions

View file

@ -9,6 +9,7 @@ import aiohttp
import requests
from spotipy import Spotify, SpotifyException
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
@ -18,6 +19,7 @@ from homeassistant.helpers.config_entry_oauth2_flow import (
OAuth2Session,
async_get_config_entry_implementation,
)
from homeassistant.helpers.typing import ConfigType
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
from .browse_media import async_browse_media
@ -51,6 +53,22 @@ class HomeAssistantSpotifyData:
session: OAuth2Session
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the Spotify 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 Spotify from a config entry."""
implementation = await async_get_config_entry_implementation(hass, entry)

View file

@ -4,7 +4,7 @@
"documentation": "https://www.home-assistant.io/integrations/spotify",
"requirements": ["spotipy==2.20.0"],
"zeroconf": ["_spotify-connect._tcp.local."],
"dependencies": ["application_credentials"],
"dependencies": ["application_credentials", "repairs"],
"codeowners": ["@frenck"],
"config_flow": true,
"quality_scale": "silver",

View file

@ -21,5 +21,11 @@
"info": {
"api_endpoint_reachable": "Spotify API endpoint reachable"
}
},
"issues": {
"removed_yaml": {
"title": "The Spotify YAML configuration has been removed",
"description": "Configuring Spotify 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."
}
}
}

View file

@ -19,6 +19,12 @@
}
}
},
"issues": {
"removed_yaml": {
"description": "Configuring Spotify 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 Spotify YAML configuration has been removed"
}
},
"system_health": {
"info": {
"api_endpoint_reachable": "Spotify API endpoint reachable"