Skip to content

Add support for tapo login_version 3 in sslaestransport#1638

Merged
rytilahti merged 13 commits intopython-kasa:masterfrom
ZeliardM:feature/camera-encryption-type-3-default-credentials
Feb 22, 2026
Merged

Add support for tapo login_version 3 in sslaestransport#1638
rytilahti merged 13 commits intopython-kasa:masterfrom
ZeliardM:feature/camera-encryption-type-3-default-credentials

Conversation

@ZeliardM
Copy link
Contributor

@ZeliardM ZeliardM commented Jan 9, 2026

Updates to get_default_credentials and DEFAULT_CREDENTIALS for handling a new default password for encryption_type 3 in TAPOCAMERA devices that use encryption_type 3.

This adds support for devices like TC40.

Copilot AI review requested due to automatic review settings January 9, 2026 14:31
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Jan 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.98%. Comparing base (30a8fd4) to head (1204b9e).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1638   +/-   ##
=======================================
  Coverage   92.98%   92.98%           
=======================================
  Files         157      157           
  Lines        9750     9753    +3     
  Branches      992      993    +1     
=======================================
+ Hits         9066     9069    +3     
  Misses        484      484           
  Partials      200      200           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ZeliardM
Copy link
Contributor Author

@rytilahti This one should be good as well, here's a summary of the PR:

  • Modified the default credentials to add a new TAPOCAMERA_LV3. Looking through the APK code found this new default password that was being used for the smartcamdevice.py for logging in if the username and password provided didn't work. This new password is selected from the login_version in the APK so that's what I did here.
    -Updated and modified all the tests to work with the new credentials and proper fixture handling for tests as well.

@paravoid
Copy link

A minor thing: in the CLI, autodiscovery works, but explicitly passing --type camera does not, nor does --type camera --login-version 3. I believe this is because the code assumes, and forces/overrides login_version to 2:

    elif type in {"smart", "camera"} or (device_family and encrypt_type):
        if type == "camera":
            encrypt_type = "AES"
            https = True
            login_version = 2
            device_family = "SMART.IPCAMERA"

@paravoid
Copy link

That said, perfect is the enemy of good :) I think this PR is necessary for some devices and working already, so I believe it should be merged as-is.

@ZeliardM
Copy link
Contributor Author

@paravoid I'll look into the CLI issues before we merge this. There's still a lot going on with other transport and protocol issues as well that are trying to be resolved before a new version is released.

@rytilahti rytilahti added enhancement New feature or request new device New device supported due to fixture being added labels Feb 21, 2026
Copy link
Member

@rytilahti rytilahti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks straightforward to me, please rebase and then this is ready to be merged, thanks!

Will this also make #1602 obsolete?

@ZeliardM
Copy link
Contributor Author

@rytilahti I've rebased. I'm not really sure what #1602 is doing to be honest. Maybe. Let me pull those fixture files and see if they work with this branch. The original PR for those #1596 was closed out automatically.

@ZeliardM
Copy link
Contributor Author

@rytilahti No, #1602 still does things differently because the actual fixture files in #1596 don't work in my code here. The discovery_result is different for D225 does not have any encrypt_info and that is what the changes in #1602 fix. Then you should be able to re-open #1596 and add the fixture files from there.

This one is good to go though.

@rytilahti rytilahti changed the title Update SSL AES Transport and default_credentials for encryption_type 3 Add support for tapo login_version 3 in sslaestransport Feb 21, 2026
@ZeliardM
Copy link
Contributor Author

ZeliardM commented Feb 22, 2026

@rytilahti This should be clear to go now.

Copy link
Member

@rytilahti rytilahti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@rytilahti rytilahti merged commit eefbf9e into python-kasa:master Feb 22, 2026
18 checks passed
@ZeliardM ZeliardM deleted the feature/camera-encryption-type-3-default-credentials branch February 22, 2026 20:10
@ZeliardM
Copy link
Contributor Author

@paravoid I missed getting the fix for the CLI into this release, will get it pushed in another PR. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request new device New device supported due to fixture being added

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants