Skip to content

Commit

Permalink
fix: ignore typerrors for update_last_called
Browse files Browse the repository at this point in the history
Activites page may return {"message":"Rate exceeded"} with a http 200
message.
closes #1196
  • Loading branch information
alandtse committed Feb 26, 2021
1 parent 9e62535 commit c2c57ed
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion custom_components/alexa_media/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,15 @@ async def update_last_called(login_obj, last_called=None, force=False):
to notify listeners.
"""
if not last_called or not (last_called and last_called.get("summary")):
last_called = await AlexaAPI.get_last_device_serial(login_obj)
try:
last_called = await AlexaAPI.get_last_device_serial(login_obj)
except TypeError:
_LOGGER.debug(
"%s: Error updating last_called: %s",
hide_email(email),
hide_serial(last_called),
)
return
_LOGGER.debug(
"%s: Updated last_called: %s", hide_email(email), hide_serial(last_called)
)
Expand Down

0 comments on commit c2c57ed

Please sign in to comment.