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

chore: release 2024-10-05 #2591

Merged
merged 2 commits into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
10 changes: 9 additions & 1 deletion custom_components/alexa_media/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,11 @@ async def async_step_user(self, user_input=None):

""" External URL for cloud connected services """
try:
DEFAULT_PUBLIC_URL: str = get_url(self.hass, allow_internal=False)
url: str = get_url(self.hass, allow_internal=False)
except NoURLAvailableError:
DEFAULT_PUBLIC_URL = ""
else:
DEFAULT_PUBLIC_URL = url if url.endswith("/") else url + "/"

self.proxy_schema = OrderedDict(
[
Expand Down Expand Up @@ -768,6 +770,8 @@ def _save_user_input_to_config(self, user_input=None) -> None:
if CONF_URL in user_input:
self.config[CONF_URL] = user_input[CONF_URL]
if CONF_PUBLIC_URL in user_input:
if not user_input[CONF_PUBLIC_URL].endswith("/"):
user_input[CONF_PUBLIC_URL] = user_input[CONF_PUBLIC_URL] + "/"
self.config[CONF_PUBLIC_URL] = user_input[CONF_PUBLIC_URL]
if CONF_SCAN_INTERVAL in user_input:
self.config[CONF_SCAN_INTERVAL] = (
Expand Down Expand Up @@ -951,6 +955,10 @@ async def async_step_init(
user_input[CONF_OTPSECRET] = self.config_entry.data[CONF_OTPSECRET]
if CONF_OAUTH in self.config_entry.data:
user_input[CONF_OAUTH] = self.config_entry.data[CONF_OAUTH]
"""Ensure public_url ends with trailing slash"""
if CONF_PUBLIC_URL in self.config_entry.data:
if not user_input[CONF_PUBLIC_URL].endswith("/"):
user_input[CONF_PUBLIC_URL] = user_input[CONF_PUBLIC_URL] + "/"

self.hass.config_entries.async_update_entry(
self.config_entry, data=user_input, options=self.config_entry.options
Expand Down
2 changes: 1 addition & 1 deletion custom_components/alexa_media/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def _existing_serials(hass, login_obj) -> list:
.get("devices", {})
.get("media_player", {})
)
for serial in existing_serials:
for serial in existing_serials[:]:
device = device_data.get(serial, {})
if "appDeviceList" in device and device["appDeviceList"]:
apps = [
Expand Down
Loading