bimmerconnected / bimmer_connected

🚘 Library to query the status of your BMW or Mini from the ConnectedDrive portal
Apache License 2.0
365 stars 79 forks source link

Optimize capture verification method in China region #564

Closed Yixi closed 1 year ago

Yixi commented 1 year ago

Proposed change

Optimized the logic of automatically passing the graphical captcha during login in the China region.

Type of change

Additional information

Recently found that it is not possible to obtain the verification code through polling. As long as the slider capture has more than two or three incorrect attempts, the current slider capture will become unavailable. Introduced the Pillow library to automatically identify the position value required for the slider capture image processing. Currently, it can basically ensure that it can directly log in every time. There will no longer be multiple requests errors when attempting to use a verification code.

image

Checklist

codecov[bot] commented 1 year ago

Codecov Report

All modified lines are covered by tests :white_check_mark:

Comparison is base (6e97a82) 100.00% compared to head (3b30bc1) 100.00%. Report is 2 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #564 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 17 17 Lines 1334 1382 +48 ========================================= + Hits 1334 1382 +48 ``` | [Flag](https://app.codecov.io/gh/bimmerconnected/bimmer_connected/pull/564/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bimmerconnected) | Coverage Δ | | |---|---|---| | [3.10](https://app.codecov.io/gh/bimmerconnected/bimmer_connected/pull/564/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bimmerconnected) | `100.00% <100.00%> (ø)` | | | [3.11](https://app.codecov.io/gh/bimmerconnected/bimmer_connected/pull/564/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bimmerconnected) | `100.00% <100.00%> (ø)` | | | [3.12](https://app.codecov.io/gh/bimmerconnected/bimmer_connected/pull/564/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bimmerconnected) | `100.00% <100.00%> (ø)` | | | [3.8](https://app.codecov.io/gh/bimmerconnected/bimmer_connected/pull/564/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bimmerconnected) | `100.00% <100.00%> (ø)` | | | [3.9](https://app.codecov.io/gh/bimmerconnected/bimmer_connected/pull/564/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bimmerconnected) | `100.00% <100.00%> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bimmerconnected#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/bimmerconnected/bimmer_connected/pull/564?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bimmerconnected) | Coverage Δ | | |---|---|---| | [bimmer\_connected/api/authentication.py](https://app.codecov.io/gh/bimmerconnected/bimmer_connected/pull/564?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bimmerconnected#diff-YmltbWVyX2Nvbm5lY3RlZC9hcGkvYXV0aGVudGljYXRpb24ucHk=) | `100.00% <100.00%> (ø)` | | | [bimmer\_connected/api/utils.py](https://app.codecov.io/gh/bimmerconnected/bimmer_connected/pull/564?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bimmerconnected#diff-YmltbWVyX2Nvbm5lY3RlZC9hcGkvdXRpbHMucHk=) | `100.00% <100.00%> (ø)` | | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/bimmerconnected/bimmer_connected/pull/564/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bimmerconnected)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Yixi commented 1 year ago

What's missing before the merge? @rikroe

rikroe commented 1 year ago

Just move types-Pillow to requirements-test.txt (as mentioned in the review) and all should be good.

Yixi commented 1 year ago

Just move types-Pillow to requirements-test.txt (as mentioned in the review) and all should be good.

Hmm.. Maybe I missed the review message, but I've already move types-Pillow to requirements-test.txt