GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Use the real discovery reply in the TD21 fixture by Smugaski · Pull Request #1800 · python-kasa/python-kasa

Conversation

@Smugaski

@Smugaski Smugaski commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

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

  • tests/fixtures/smartcam/TD21(EU)_2.0_1.1.5.json: replaces the hand-written discovery_result with the real, redacted reply (from dump_devinfo --host ...). The _comment marker is removed since nothing in the fixture is hand-made any more. The device state is re-recorded at the same time, so the rest of the fixture changes slightly (battery, clock, Wi-Fi scan).
  • tests/discovery_fixtures.py: the discovery mock now mirrors the fallback from Discovery: accept cameras that only send the encrypt_type list #1770.

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

  • All tests parametrized on the TD21 pass (108 passed, 2 skipped).
  • test_discovery.py, test_device_factory.py and test_devtools.py pass across all fixtures (3970 passed).
  • ruff, ruff format and mypy are clean on the changed files.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Smugaski added 2 commits October 13, 2026 20:01
@Smugaski
Handle top level encrypt_type in discovery fixture mock
321c104
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.
@Smugaski
Use the real discovery reply in the TD21 fixture
9356be1
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

codecov Bot commented Oct 13, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.43%. Comparing base (f1a8d38) to head (9356be1).

Additional details and impacted files
@@           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.
📢 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.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

rytilahti
rytilahti approved these changes Oct 14, 2026
View reviewed changes

@rytilahti rytilahti left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thank you @Smugaski!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Smugaski reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@rytilahti
rytilahti merged commit d6e80d2 into python-kasa:master Oct 14, 2026
22 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@rytilahti rytilahti mentioned this pull request Oct 25, 2026
Prepare 0.12.0 #1811
Merged
rytilahti added a commit that referenced this pull request Oct 25, 2026
@rytilahti
Prepare 0.12.0 (#1811)
a178fba
## [0.12.0](https://github.com/python-kasa/python-kasa/tree/0.12.0)
(2026-10-25)

This release include several compatibility fixes (updated accepted SSL
ciphers, removal of Homekit from the default update cycle).
The new API `Device.supports_module()` provide a way to find out if the
device supports some specific module, e.g., HomeKit, without including
it in the default update cycle.

[Full
Changelog](0.11.0.1...0.12.0)

**Fixed bugs:**

- Keep hub children when the child component list is missing
[\#1797](#1797)
(@Richardtristan)
- Strip multi-word rich tags when rich is not installed
[\#1807](#1807)
(@wolfgang-aura)
- Add Device.supports_module() and stop querying HomeKit for iot devices
[\#1808](#1808)
(@rytilahti)
- Keep multi requests for smartcam devices after a timeout
[\#1802](#1802)
(@hugaraujo)
- Consolidate SSL ciphers and use them in SslTransport
[\#1798](#1798)
(@rytilahti)
- Raise UnsupportedDeviceError instead of crashing on unknown device
types [\#1781](#1781)
(@GhostCoder6969)

**Added support for devices:**

- Add TD21(EU) device fixture
[\#1786](#1786)
(@Smugaski)
- Add P116M(IN) fixture
[\#1795](#1795)
(@Partha-dev01)

**Project maintenance:**

- Add Python 3.15 to supported versions and update pins
[\#1793](#1793)
(@rytilahti)
- Generate the changelog with git-cliff and draft releases in CI
[\#1809](#1809)
(@rytilahti)
- Build and check packages in CI and publish workflows
[\#1782](#1782)
(@rytilahti)

**Other changes:**

- Use the real discovery reply in the TD21 fixture
[\#1800](#1800)
(@Smugaski)
pillarsdotnet pushed a commit to pillarsdotnet/python-kasa that referenced this pull request Oct 30, 2026
@Smugaski
Use the real discovery reply in the TD21 fixture (python-kasa#1800)
67f85f5
Use the real discovery reply in the TD21 fixture. 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.

This commit uses the real device response for the fixture, so the `_comment` marker is removed since
nothing in the fixture is hand-made any more. 


---------

Co-authored-by: Smugaski <[email protected]>
pillarsdotnet pushed a commit to pillarsdotnet/python-kasa that referenced this pull request Oct 30, 2026
@rytilahti
Prepare 0.12.0 (python-kasa#1811)
7ddf1ef
## [0.12.0](https://github.com/python-kasa/python-kasa/tree/0.12.0)
(2026-10-25)

This release include several compatibility fixes (updated accepted SSL
ciphers, removal of Homekit from the default update cycle).
The new API `Device.supports_module()` provide a way to find out if the
device supports some specific module, e.g., HomeKit, without including
it in the default update cycle.

[Full
Changelog](python-kasa/python-kasa@0.11.0.1...0.12.0)

**Fixed bugs:**

- Keep hub children when the child component list is missing
[\python-kasa#1797](python-kasa#1797)
(@Richardtristan)
- Strip multi-word rich tags when rich is not installed
[\python-kasa#1807](python-kasa#1807)
(@wolfgang-aura)
- Add Device.supports_module() and stop querying HomeKit for iot devices
[\python-kasa#1808](python-kasa#1808)
(@rytilahti)
- Keep multi requests for smartcam devices after a timeout
[\python-kasa#1802](python-kasa#1802)
(@hugaraujo)
- Consolidate SSL ciphers and use them in SslTransport
[\python-kasa#1798](python-kasa#1798)
(@rytilahti)
- Raise UnsupportedDeviceError instead of crashing on unknown device
types [\python-kasa#1781](python-kasa#1781)
(@GhostCoder6969)

**Added support for devices:**

- Add TD21(EU) device fixture
[\python-kasa#1786](python-kasa#1786)
(@Smugaski)
- Add P116M(IN) fixture
[\python-kasa#1795](python-kasa#1795)
(@Partha-dev01)

**Project maintenance:**

- Add Python 3.15 to supported versions and update pins
[\python-kasa#1793](python-kasa#1793)
(@rytilahti)
- Generate the changelog with git-cliff and draft releases in CI
[\python-kasa#1809](python-kasa#1809)
(@rytilahti)
- Build and check packages in CI and publish workflows
[\python-kasa#1782](python-kasa#1782)
(@rytilahti)

**Other changes:**

- Use the real discovery reply in the TD21 fixture
[\python-kasa#1800](python-kasa#1800)
(@Smugaski)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@rytilahti rytilahti rytilahti approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@Smugaski @rytilahti
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.