Fix reauthentication bug and support authentication intervals #36
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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