Skip to content

Commit

Permalink
feat(custom_components): update alexa_media_player via HACS
Browse files Browse the repository at this point in the history
  • Loading branch information
aronnebrivio committed Sep 7, 2022
1 parent d9bac97 commit 637b211
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
21 changes: 16 additions & 5 deletions custom_components/alexa_media/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,17 @@ async def async_step_user(self, user_input=None):
errors={"base": "2fa_key_invalid"},
description_placeholders={"message": ""},
)
hass_url: str = user_input.get(CONF_HASS_URL)
try:
hass_url: str = user_input.get(
CONF_HASS_URL, get_url(self.hass, prefer_external=True)
)
except NoURLAvailableError:
_LOGGER.debug("No Home Assistant URL found in config or detected; forcing user form")
return self.async_show_form(
step_id="user",
data_schema=vol.Schema(self.proxy_schema),
description_placeholders={"message": ""},
)
hass_url_valid: bool = False
hass_url_error: str = ""
async with ClientSession() as session:
Expand All @@ -268,9 +278,9 @@ async def async_step_user(self, user_input=None):
description_placeholders={
"email": self.login.email,
"hass_url": hass_url,
"error": hass_url_error
"error": hass_url_error,
},
)
)
if (
user_input
and user_input.get(CONF_OTPSECRET)
Expand Down Expand Up @@ -301,7 +311,8 @@ async def async_step_start_proxy(self, user_input=None):
if not self.proxy:
try:
self.proxy = AlexaProxy(
self.login, str(URL(self.config.get(CONF_HASS_URL)).with_path(AUTH_PROXY_PATH))
self.login,
str(URL(self.config.get(CONF_HASS_URL)).with_path(AUTH_PROXY_PATH)),
)
except ValueError as ex:
return self.async_show_form(
Expand Down Expand Up @@ -558,7 +569,7 @@ async def _test_login(self):
"access_token": login.access_token,
"refresh_token": login.refresh_token,
"expires_in": login.expires_in,
"mac_dms": login.mac_dms
"mac_dms": login.mac_dms,
}
self.hass.data.setdefault(
DATA_ALEXAMEDIA,
Expand Down
2 changes: 1 addition & 1 deletion custom_components/alexa_media/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"""
from datetime import timedelta

__version__ = "4.1.1"
__version__ = "4.1.2"
PROJECT_URL = "https://github.com/custom-components/alexa_media_player/"
ISSUE_URL = f"{PROJECT_URL}issues"
NOTIFY_URL = f"{PROJECT_URL}wiki/Configuration%3A-Notification-Component#use-the-notifyalexa_media-service"
Expand Down
4 changes: 2 additions & 2 deletions custom_components/alexa_media/manifest.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"domain": "alexa_media",
"name": "Alexa Media Player",
"version": "4.1.1",
"version": "4.1.2",
"config_flow": true,
"documentation": "https://github.com/custom-components/alexa_media_player/wiki",
"issue_tracker": "https://github.com/custom-components/alexa_media_player/issues",
"dependencies": ["persistent_notification", "http"],
"codeowners": ["@alandtse", "@keatontaylor"],
"requirements": ["alexapy==1.26.2", "packaging>=20.3", "wrapt>=1.12.1"],
"requirements": ["alexapy==1.26.3", "packaging>=20.3", "wrapt>=1.12.1"],
"iot_class": "cloud_polling"
}

0 comments on commit 637b211

Please sign in to comment.