Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix!: deprecate YAML configuration #2685

Merged
merged 8 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions custom_components/alexa_media/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
from homeassistant.helpers import config_validation as cv, device_registry as dr
from homeassistant.helpers.discovery import async_load_platform
from homeassistant.helpers.dispatcher import async_dispatcher_send
from homeassistant.helpers.issue_registry import IssueSeverity, async_create_issue
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
from homeassistant.util import dt, slugify
import voluptuous as vol
Expand Down Expand Up @@ -134,6 +135,25 @@ async def async_setup(hass, config, discovery_info=None):
)
return True

async_create_issue(
hass,
DOMAIN,
"deprecated_yaml_configuration",
is_fixable=False,
issue_domain=DOMAIN,
severity=IssueSeverity.WARNING,
translation_key="deprecated_yaml_configuration",
learn_more_url="https://github.com/alandtse/alexa_media_player/wiki/Configuration#configurationyaml",
)
_LOGGER.warning(
"YAML configuration of Alexa Media Player is deprecated "
"and will be removed in version 4.14.0."
"There will be no automatic import of this. "
"Please remove it from your configuration, "
"restart Home Assistant and use the UI to configure it instead. "
"Settings > Devices and services > Integrations > ADD INTEGRATION"
)

domainconfig = config.get(DOMAIN)
for account in domainconfig[CONF_ACCOUNTS]:
entry_found = False
Expand Down
17 changes: 17 additions & 0 deletions custom_components/alexa_media/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,22 @@
}
}
}
},
"issues": {
"restart_required": {
danielbrunt57 marked this conversation as resolved.
Show resolved Hide resolved
"title": "Restart required",
"fix_flow": {
"step": {
"confirm_restart": {
"title": "Restart required",
"description": "Restart of Home Assistant is required to finish download/update of {name}, click submit to restart now."
}
}
}
},
"deprecated_yaml_configuration": {
"title": "YAML configuration is deprecated",
"description": "YAML configuration of Alexa Media Player is deprecated\nand will be removed in version 4.14.0.\nThere will be no automatic import of this.\nPlease remove it from your configuration, restart Home Assistant and use the UI to configure it instead.\nSettings > Devices & services > Integrations > ADD INTEGRATION"
alandtse marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
Loading