Repository navigation
Stop encryption method detection when the router locks logins - #556
Open
manueltarouca wants to merge 1 commit into
Open
manueltarouca wants to merge 1 commit into
manueltarouca wants to merge 1 commit into
Conversation
XMO_LOGIN_RETRY_ERR is the router's "too many attempts, login locked" response (the stock web UI shows a lock countdown for it). Detection treated it like a wrong method and kept trying, adding failed logins to an active lock and finally returning None as if no method were supported. It now raises LoginRetryErrorException after the first locked response.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
get_encryption_method()keeps logging in after the router has locked logins.Problem
XMO_LOGIN_RETRY_ERR(16777224) means "too many attempts, login locked".The router's stock web UI handles it in
js/scripts.js:it sets
loginRetryOvertimeand shows the lock countdown (guiLockTime).get_encryption_method()treats it as "wrong method" and tries the next one:None, which looks like "no supported method"Reproduced with a local server that answers every login with
XMO_LOGIN_RETRY_ERR:3 login attempts, then
None.Fix
XMO_LOGIN_RETRY_ERRand raiseLoginRetryErrorException.XMO_AUTHENTICATION_ERRstill moves on to the next method.Behaviour change: callers get
LoginRetryErrorExceptioninstead ofNonewhen the routeris locked. The ha-sagemcom-fast config flow already handles this exception (
login_retry_error).Tests
tests/unit/test_encryption_method.py, plus fixturelogin_retry_error.json:main(3 attempts, returnsNone).