Skip to content

Fix reauthentication bug and support authentication intervals #36

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

vilsufi
Copy link

@vilsufi vilsufi commented Jan 30, 2021

Recursion was used for implementing retry after failed operation. However, after the error_report flag was raised, authentication always returned None. Changed retry logic to iterative implementation to fix the bug and for easier reading of the code. Also removed error_report flag, which seemed to be designed to reduce log pollution during the recursive retries.
Added auth_interval parameter for supporting persistent authentication, with reauthentication after given number of seconds (default 10). For some reason the "non-legacy" implementation was to reauthenticate every time (two calls to authenticated + one call for the operation). I had no trouble with my W215 socket without authenticating every time, but maybe there's some device which requires it? auth_interval can be set to zero to force reauthentication every time, but this changes the default operation.
Added some debug logging.
Bump version number to 0.7.1

@LinuxChristian
Copy link
Owner

@vilsufi, thanks for your PR and I am really sorry for not getting back to you sooner. I never got notifications from GH about the PR. Likely because you didn't add me as a reviewer 🤔 You should just have pinged me when I didn't respond.

I will take a look and get back to you soon. Hopefully within a week. I don't really use the plug myself anymore so it just takes a bit of time to ensure everything still works.

@LinuxChristian LinuxChristian self-requested a review December 1, 2021 08:37
@LinuxChristian
Copy link
Owner

I am very sorry for taking so long to get on with this - I really appriciate the contribution

To anyone reading this in the future - I don't have access to my plugs anymore so I cannot ensure this PR will not break support for older plugs. If someone is able to pull this branch and test the changes I would be happy to merge this. Just ping me in the PR with the steps you have performed, the tested hardware version(s) and your results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants