KP125M(US) 1.4.1 TPAP validation: fixture + blank-credential fallback - #8
Open
RayWangyangMa wants to merge 2 commits into
Open
RayWangyangMa wants to merge 2 commits into
RayWangyangMa wants to merge 2 commits into
Conversation
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.
KP125M(US) fw 1.4.1 TPAP validation + fixture + one small transport fix
My KP125M(US) (hw 1.0) recently got firmware 1.4.1 Build 260721 pushed and switched to TPAP — same situation as the two KP125M reports at the bottom of python-kasa#1590. Discovery announces:
so this is the plain-HTTP (
tls: 0) SPAKE2+ path withdac/nocflags set. KLAP is fully shut off on this firmware (handshake1 returns 403), so this branch is the only local-control path left.Validation against the real plug (this branch, unmodified)
Discover.discover_singlewith credentialsSmartProtocol + TpapTransport + SmartDevice + httpupdate()(device info, usage, energy monitoring, emeter batches)turn_on()/turn_off()round-trip + re-updateWorks first try — nice job on this transport.
What this PR adds
tests/fixtures/smart/KP125M(US)_1.0_1.4.1.json— dumped withdevtools/dump_devinfo.pyfrom the real device (existing fixtures for this model stop at 1.2.3, pre-TPAP), plus theSUPPORTED.mdregen.Blank-credential fallback in
TpapTransport.__init__— the new fixture caught this:test_features_all[KP125M(US)_1.0_1.4.1.json-SMART]failed withAuthenticationError: Tapo plug requires authentication.The CLI test connects without credentials;SmartDevice.update()requirescredentialsorcredentials_hashon the transport.KlapTransportfalls back to blankCredentials()at init when neither is supplied, butTpapTransportdidn't, so both stayedNoneand update() raised before the (fake) transport was ever used. The fix mirrors the KLAP behavior:Real-device behavior is unchanged (a blank-credential SPAKE2+ handshake still fails with an auth error at the transport, same as KLAP's).
Tests
Real-device toggle re-verified after the transport change. Happy to run more targeted tests on this hardware if useful — this plug drives my 3D-printer exhaust fans, so it's permanently on my LAN.