mirror of
https://github.com/python-kasa/python-kasa.git
synced 2026-10-16 01:24:15 +00:00
Use the real discovery reply in the TD21 fixture (#1800)
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 <Smugaski@users.noreply.github.com>
This commit is contained in:
@@ -200,6 +200,10 @@ def create_discovery_mock(ip: str, fixture_data: dict):
|
||||
):
|
||||
login_version = max([int(i) for i in et])
|
||||
https = discovery_result["mgt_encrypt_schm"]["is_support_https"]
|
||||
if not encrypt_type and https and login_version == 3:
|
||||
# Mirrors Discover._get_connection_parameters for cameras that
|
||||
# only send the top level encrypt_type list
|
||||
encrypt_type = "AES"
|
||||
http_port = discovery_result["mgt_encrypt_schm"].get("http_port")
|
||||
if not http_port: # noqa: SIM108
|
||||
# Not all discovery responses set the http port, i.e. smartcam.
|
||||
|
||||
Reference in New Issue
Block a user