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 6 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
91 changes: 47 additions & 44 deletions custom_components/alexa_media/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,59 +6,59 @@
"reauth_successful": "Alexa Media Player successfully reauthenticated. Please ignore the \"Aborted\" message from HA."
},
"error": {
"2fa_key_invalid": "Invalid OTP Authenticator App key",
"connection_error": "Error connecting; check network and retry",
"identifier_exists": "Email for Alexa URL already registered",
"invalid_credentials": "Invalid credentials",
"invalid_url": "URL is invalid: {message}",
"2fa_key_invalid": "Invalid Built-In 2FA key",
"unable_to_connect_hass_url": "Unable to connect to Home Assistant URL. Please check the Internal URL under Configuration -> General",
"unable_to_connect_hass_url": "Unable to connect to Home Assistant local URL. Please check the Internal URL under Settings > System > Network",
"unknown_error": "Unknown error: {message}"
},
"step": {
"proxy_warning": {
"data": {
"proxy_warning": "Ignore and Continue >>> I understand that NO support for login issues are provided when bypassing this warning! <<<"
},
"description": "The HA server cannot connect to the URL provided: {hass_url}.\n> {error}\n\nTo fix this, please confirm your **HA server** can reach {hass_url}. This field is from the Internal URL under Settings > System > Network.\n\nIf you are **certain** your client can reach this URL, you can bypass this warning.",
"title": "Alexa Media Player - Unable to Connect to HA Local URL"
},
"totp_register": {
"data": {
"registered": "Yes, OTP code was verified"
},
"description": "**{email} - alexa.{url}** \nHave you verified the OTP code in Amazon 2SV? \n >OTP Code: {message}",
"title": "Alexa Media Player - OTP Confirmation"
},
"user": {
"data": {
"url": "Amazon region domain (e.g., amazon.co.uk)",
"url": "Your Amazon domain (e.g., amazon.co.uk)",
"hass_url": "Local URL to access Home Assistant (message}",
"public_url": "Internet URL to access Home Assistant",
"email": "Email Address",
"password": "Password",
"otp_secret": "OTP Authenticator App Key (52 characters)",
"securitycode": "[%key_id:55616596%]",
"otp_secret": "Built-in 2FA App Key - This is 52 characters, not six!",
"hass_url": "Local URL to access Home Assistant",
"public_url": "Public Url to access Home Assistant",
"include_devices": "Included device (comma separated)",
"exclude_devices": "Excluded device (comma separated)",
"scan_interval": "Seconds between scans",
"queue_delay": "Seconds to wait to queue commands together",
"include_devices": "Included device(s) (comma separated)",
"exclude_devices": "Excluded device(s) (comma separated)",
"queue_delay": "Multiple command queue delay (seconds)",
"scan_interval": "Scheduled polling interval (seconds)",
"extended_entity_discovery": "Include devices connected via Echo",
"debug": "Advanced debugging"
},
"description": "Required *",
"description": "Required fields * {message}",
"title": "Alexa Media Player - Configuration"
},
"proxy_warning": {
"data": {
"proxy_warning": "Ignore and Continue - I understand that no support for login issues are provided for bypassing this warning."
},
"description": "The HA server cannot connect to the URL provided: {hass_url}.\n> {error}\n\nTo fix this, please confirm your **HA server** can reach {hass_url}. This field is from the External URL under Configuration -> General but you can try your internal URL.\n\nIf you are **certain** your client can reach this URL, you can bypass this warning.",
"title": "Alexa Media Player - Unable to Connect to HA URL"
},
"totp_register": {
"data": {
"registered": "OTP from the Built-in 2FA App Key confirmed successfully."
},
"description": "**{email} - alexa.{url}** \nHave you successfully confirmed an OTP from the Built-in 2FA App Key with Amazon? \n >OTP Code {message}",
"title": "Alexa Media Player - OTP Confirmation"
}
}
},
"options": {
"step": {
"init": {
"data": {
"public_url": "Public URL to access Home Assistant (including trailing '/')",
"include_devices": "Included device (comma separated)",
"exclude_devices": "Excluded device (comma separated)",
"scan_interval": "Seconds between scans",
"queue_delay": "Seconds to wait to queue commands together",
"public_url": "Public URL to access Home Assistant",
"include_devices": "Include device(s) (comma separated)",
"exclude_devices": "Exclude device(s) (comma separated)",
"queue_delay": "Multiple command queue delay (seconds)",
"scan_interval": "Scheduled polling interval (seconds)",
"extended_entity_discovery": "Include devices connected via Echo",
"debug": "Advanced debugging"
},
Expand All @@ -68,20 +68,6 @@
}
},
"services": {
"clear_history": {
"name": "Clear Amazon Voice History",
"description": "Clear last entries from Alexa Voice history for each Alexa account.",
"fields": {
"email": {
"name": "Email address",
"description": "Accounts to clear. Empty will clear all."
},
"entries": {
"name": "Number of Entries",
"description": "Number of entries to clear from 1 to 50. If empty, clear 50."
}
}
},
"force_logout": {
"name": "Force Logout",
"description": "Force account to logout. Used mainly for debugging.",
Expand All @@ -102,5 +88,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