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:
smugaski
2026-10-14 19:41:52 +01:00
committed by GitHub
parent f1a8d38c9b
commit d6e80d2c78
2 changed files with 51 additions and 52 deletions

View File

@@ -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.