-
Notifications
You must be signed in to change notification settings - Fork 294
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: delete cookiefile when removing config entry #2462
Conversation
Added code to delete pickle file when removing config entry.
for more information, see https://pre-commit.ci
Can you confirm the file isn't handled at the alexapy level? If so, any deletion should be handled there via an API call. |
Fixed an error in _LOGGER when file can't be deleted
for more information, see https://pre-commit.ci
No, it's not and it always gets left behind when the config entry is removed and has caused issues galore for a little while now for users trying to fix other setup issues. Countless posts stating "Delete the integration, delete the pickle file and try again!" |
The only reference in alexapy to the pickle file is in alexalogin.py:
and this:
|
Then you should create a delete_cookiefile in alexapy and then call that in amp. |
Something like this then? alexapy debug:
alexa_media debug:
|
Uses new alexapy function delete_cookiefile() instead of os.remove(pickle)
Note: this fix requires alexapy merge request !380 |
So what was the deal before for why it was failing? |
It never was failing. It was never even trying! |
fix: delete cookiefile when removing config entry (#2462)
I see you've been busy! What about the underlying requirement in alexapy? v4.12.8 will need a new alexapy (==1.28.3?) to be able to delete the cookiefile... |
I mean if it required a version bump it should've been in the PR. Please only submit complete PRs. I don't have time to guess if it needs more parts to it. |
Please mark it as a Draft if it's incomplete. |
Forgive me for still being quite new to this PR stuff and not knowing everything yet but I do not know how or where that would be specified. I did add comment |
In these cases, I suggest you first submit the PR to AlexaPy and then only after AlexaPy has your PR merged you submit the PR here, including the bump in AlexaPy's version. Might take some time, given alandtse free time, but it is the safest way. |
@chrisvblemos |
I've added a new issue (#2470) with how to eliminate the error for now.
|
New PR #2471 submitted to check if AlexaLogin.delete_cookiefile exists before trying to call it. |
Delete pickle file when removing config entry as it's no longer needed and can cause issues when re-adding the integration entry.