Skip to content

Commit

Permalink
perf: only update auth on new_devices
Browse files Browse the repository at this point in the history
  • Loading branch information
alandtse committed Jan 15, 2020
1 parent 899695d commit 37cafaf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions custom_components/alexa_media/__init__.py
Expand Up @@ -178,7 +178,7 @@ async def close_alexa_media(event=None) -> None:
"auth_info": None,
"configurator": [],
},
)
)
login = hass.data[DATA_ALEXAMEDIA]["accounts"][email].get(
"login_obj",
AlexaLogin(url, email, password, hass.config.path, account.get(CONF_DEBUG)),
Expand Down Expand Up @@ -438,7 +438,8 @@ async def update_devices(login_obj):
dnd = {}
raw_notifications = {}
try:
auth_info = await AlexaAPI.get_authentication(login_obj)
if new_devices:
auth_info = await AlexaAPI.get_authentication(login_obj)
devices = await AlexaAPI.get_devices(login_obj)
bluetooth = await AlexaAPI.get_bluetooth(login_obj)
preferences = await AlexaAPI.get_device_preferences(login_obj)
Expand Down

0 comments on commit 37cafaf

Please sign in to comment.