Fix HS300 KLAP v2 direct connect#1676
Closed
jazvw wants to merge 2 commits intopython-kasa:masterfrom
Closed
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1676 +/- ##
=======================================
Coverage 93.22% 93.22%
=======================================
Files 157 157
Lines 9815 9818 +3
Branches 1003 1004 +1
=======================================
+ Hits 9150 9153 +3
Misses 472 472
Partials 193 193 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
|
Ok, thanks! |
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
This fixes direct connection for HS300 devices that report
IOT.SMARTPLUGSWITCHwithKLAPandlogin_version=2.Changes:
KlapTransportV2forIOT.KLAPdevices whenlogin_version == 2get_sysinfo-based class detection for IOT direct-connect transports beyond XOR, so HS300 is created asIotStripinstead ofIotPlugTesting
Fixture-backed:
./.venv/bin/python -m pytest -q tests/test_hs300_klap_lv2.py -k strip_fixtureReal hardware:
./.venv/bin/python -m pytest -q tests/test_hs300_klap_lv2.py --ip=<hs300-ip> -k real_deviceAdditional targeted coverage:
./.venv/bin/python -m pytest -q -o addopts= tests/test_device_factory.py -k test_get_protocolNotes
I was able to verify this against an HS300 that uses
KLAPwithlogin_version=2.I could not test this against older HS300 variants that still use the older direct-connect path, since I do not have access to those devices.
I used Codex CLI to help trace the failure, inspect the local git history, and narrow the fix to the HS300 KLAP v2 direct-connect path.