| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Mirror the fallback in Discover._get_connection_parameters (python-kasa#1770): when a discovery reply has no encryption type in mgt_encrypt_schm and no encrypt_info, but supports https and sends encrypt_type ["3"], treat it as AES. Needed so fixtures with such a reply can be used by the discovery mock.
The TD21 answers UDP discovery on port 20004, so replace the hand-written discovery_result with the redacted device response and drop the _comment marker.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## master #1800 +/- ##
=======================================
Coverage 93.43% 93.43%
=======================================
Files 159 159
Lines 10116 10116
Branches 1044 1044
=======================================
Hits 9452 9452
Misses 471 471
Partials 193 193 ☔ View full report in Codecov by Harness.
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Use the real discovery reply in the TD21 fixture
Follow-up to #1786. I said there that the TD21 doesn't answer UDP discovery, and that was wrong: it was asleep during my first attempt, and I had skipped discovery in dump_devinfo by passing the family flags. The doorbell does answer, from port 20004.
Changes
Why a test helper change
The real reply has no encrypt_info and no encryption type in mgt_encrypt_schm, only the top-level encrypt_type: ["3"]. Discover._get_connection_parameters already handles that shape (#1770), but the mock derived the encryption type without the fallback and got None, which failed seven TD21 tests (test_discover_single, test_discover_try_connect_all, test_list_devices, test_list_update_failed). This is the first fixture with that reply shape. The helper change is four lines and does nothing for other fixtures.
Testing