Skip to content

Commit

Permalink
refactor: remove legacy login options
Browse files Browse the repository at this point in the history
Remove non-proxy login and non-oauth logins. These were provided for
compatability but caused issues when users are in this state. They are
now removed. Users who require the older compatibility should use the
older versions.

BREAKING CHANGE: Legacy login and options have been removed. These options resulted in degraded operations and generated extra support requests. You will be forced to relogin if an older method is detected.
  • Loading branch information
alandtse committed May 29, 2022
1 parent d7c9a8c commit ee724ab
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 300 deletions.
10 changes: 3 additions & 7 deletions custom_components/alexa_media/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,11 @@
from .const import (
ALEXA_COMPONENTS,
CONF_ACCOUNTS,
CONF_COOKIES_TXT,
CONF_DEBUG,
CONF_EXCLUDE_DEVICES,
CONF_EXTENDED_ENTITY_DISCOVERY,
CONF_INCLUDE_DEVICES,
CONF_OAUTH,
CONF_OAUTH_LOGIN,
CONF_OTPSECRET,
CONF_QUEUE_DELAY,
DATA_ALEXAMEDIA,
Expand Down Expand Up @@ -218,12 +216,11 @@ async def relogin(event=None) -> None:
otp_secret=account.get(CONF_OTPSECRET, ""),
oauth=account.get(CONF_OAUTH, {}),
uuid=uuid,
oauth_login=bool(
account.get(CONF_OAUTH, {}).get("access_token")
or account.get(CONF_OAUTH_LOGIN)
),
oauth_login=True,
)
hass.data[DATA_ALEXAMEDIA]["accounts"][email]["login_obj"] = login_obj
else:
login_obj.oauth_login = True
await login_obj.reset()
# await login_obj.login()
if await test_login_status(hass, config_entry, login_obj):
Expand Down Expand Up @@ -1344,7 +1341,6 @@ async def test_login_status(hass, config_entry, login) -> bool:
CONF_SCAN_INTERVAL: account[CONF_SCAN_INTERVAL].total_seconds()
if isinstance(account[CONF_SCAN_INTERVAL], timedelta)
else account[CONF_SCAN_INTERVAL],
CONF_COOKIES_TXT: account.get(CONF_COOKIES_TXT, ""),
CONF_OTPSECRET: account.get(CONF_OTPSECRET, ""),
},
)
Expand Down
Loading

0 comments on commit ee724ab

Please sign in to comment.