Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 'AlexaLogin' object has no attribute 'delete_cookiefile' #2471

Merged
merged 3 commits into from
Aug 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions custom_components/alexa_media/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1332,13 +1332,20 @@ async def async_unload_entry(hass, entry) -> bool:
if hass.data.get(DATA_ALEXAMEDIA):
hass.data.pop(DATA_ALEXAMEDIA)
# Delete cookiefile
try:
await login_obj.delete_cookiefile()
_LOGGER.debug("Deleted cookiefile")
except Exception as ex:
_LOGGER.error(
"Failed to delete cookiefile: %s",
ex,
if callable(getattr(AlexaLogin, "delete_cookiefile", None)):
try:
await login_obj.delete_cookiefile()
_LOGGER.debug("Deleted cookiefile")
except Exception as ex:
_LOGGER.error(
"Failed to delete cookiefile: %s",
ex,
)
else:
_LOGGER.warn(
"Could not remove cookiefile: /config/.storage/alexa_media.%s.pickle."
" Please manually delete the file.",
email,
)
else:
_LOGGER.debug(
Expand Down
Loading