Skip to content

Commit

Permalink
fix: catch login errors for bluetooth/lastcalled
Browse files Browse the repository at this point in the history
  • Loading branch information
alandtse committed Sep 27, 2020
1 parent 2a0496c commit 51ec251
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion custom_components/alexa_media/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
SCAN_INTERVAL,
STARTUP,
)
from .helpers import _existing_serials
from .helpers import _existing_serials, _catch_login_errors
from .notify import async_unload_entry as notify_async_unload_entry
from .services import AlexaMediaServices

Expand Down Expand Up @@ -446,6 +446,7 @@ async def async_update_data():

hass.data[DATA_ALEXAMEDIA]["accounts"][email]["new_devices"] = False

@_catch_login_errors
async def process_notifications(login_obj, raw_notifications=None):
"""Process raw notifications json."""
if not raw_notifications:
Expand Down Expand Up @@ -488,6 +489,7 @@ async def process_notifications(login_obj, raw_notifications=None):
),
)

@_catch_login_errors
async def update_last_called(login_obj, last_called=None):
"""Update the last called device for the login_obj.
Expand Down Expand Up @@ -518,6 +520,7 @@ async def update_last_called(login_obj, last_called=None):
)
hass.data[DATA_ALEXAMEDIA]["accounts"][email]["last_called"] = last_called

@_catch_login_errors
async def update_bluetooth_state(login_obj, device_serial):
"""Update the bluetooth state on ws bluetooth event."""
bluetooth = await AlexaAPI.get_bluetooth(login_obj)
Expand Down

0 comments on commit 51ec251

Please sign in to comment.