Skip to content

Commit

Permalink
Merge pull request #2703 from alandtse/dev
Browse files Browse the repository at this point in the history
chore: release 2024-11-28
  • Loading branch information
alandtse authored Nov 28, 2024
2 parents 7a76002 + e54dc06 commit c6dbea0
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 35 deletions.
25 changes: 22 additions & 3 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 All @@ -153,10 +173,9 @@ async def async_setup(hass, config, discovery_info=None):
hass.config_entries.async_update_entry(
entry,
data={
CONF_URL: account[CONF_URL],
CONF_EMAIL: account[CONF_EMAIL],
CONF_PASSWORD: account[CONF_PASSWORD],
CONF_PUBLIC_URL: account[CONF_PUBLIC_URL],
CONF_URL: account[CONF_URL],
CONF_INCLUDE_DEVICES: account[CONF_INCLUDE_DEVICES],
CONF_EXCLUDE_DEVICES: account[CONF_EXCLUDE_DEVICES],
CONF_SCAN_INTERVAL: account[
Expand Down Expand Up @@ -187,7 +206,7 @@ async def async_setup(hass, config, discovery_info=None):
CONF_URL: account[CONF_URL],
CONF_EMAIL: account[CONF_EMAIL],
CONF_PASSWORD: account[CONF_PASSWORD],
CONF_PUBLIC_URL: account.get(CONF_PUBLIC_URL, ""),
CONF_PUBLIC_URL: account[CONF_PUBLIC_URL],
CONF_INCLUDE_DEVICES: account[CONF_INCLUDE_DEVICES],
CONF_EXCLUDE_DEVICES: account[CONF_EXCLUDE_DEVICES],
CONF_SCAN_INTERVAL: account[CONF_SCAN_INTERVAL].total_seconds(),
Expand Down
6 changes: 5 additions & 1 deletion custom_components/alexa_media/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,11 @@ async def refresh(self, device=None, skip_api: bool = False):
self._set_authentication_details(device["auth_info"])
session = None
if self.available:
_LOGGER.debug("%s: Refreshing %s", self.account, self)
_LOGGER.debug(
"%s: Refreshing %s",
self.account,
self if device is None else self._device_name,
)
self._assumed_state = False
if "PAIR_BT_SOURCE" in self._capabilities:
self._source = self._get_source()
Expand Down
54 changes: 23 additions & 31 deletions custom_components/alexa_media/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"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",
"2fa_key_invalid": "Invalid Authenticator App key for Amazon 2SV",
"unable_to_connect_hass_url": "Unable to connect to Home Assistant Local URL. Please check the URL under Settings > System > Network > Home Assistant URL > Local network",
"unknown_error": "Unknown error: {message}"
},
"step": {
Expand All @@ -21,13 +21,13 @@
"email": "Email Address",
"password": "Password",
"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",
"otp_secret": "Amazon 2SV Authenticator App Key",
"hass_url": "Local network URL to access Home Assistant",
"public_url": "Public URL shared with external hosted services",
"include_devices": "Only include these devices (comma separated)",
"exclude_devices": "or Exclude these devices from all (comma separated)",
"scan_interval": "Scheduled polling interval (seconds)",
"queue_delay": "Delay to queue multiple commands together (seconds)",
"extended_entity_discovery": "Include devices connected via Echo",
"debug": "Advanced debugging"
},
Expand All @@ -38,14 +38,14 @@
"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.",
"description": "The HA server cannot connect to the URL provided: {hass_url}.\n> {error}\n\nTo fix this, please confirm your browser can reach {hass_url}. This field is from Settings > System > Network > Home Assistant URL.\n\nIf you are **certain** your browser 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."
"registered": "Yes, OTP code was verified"
},
"description": "**{email} - alexa.{url}** \nHave you successfully confirmed an OTP from the Built-in 2FA App Key with Amazon? \n >OTP Code {message}",
"description": "**{email} - alexa.{url}** \nHave you verified the OTP code in Amazon 2SV? \n >OTP Code: {message}",
"title": "Alexa Media Player - OTP Confirmation"
}
}
Expand All @@ -54,11 +54,11 @@
"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 shared with external hosted services",
"include_devices": "Only include these devices (comma separated)",
"exclude_devices": "or Exclude these devices from all (comma separated)",
"scan_interval": "Scheduled polling frequency (seconds)",
"queue_delay": "Delay to queue multiple commands together (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,11 @@
}
}
}
},
"issues": {
"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"
}
}
}

0 comments on commit c6dbea0

Please sign in to comment.