mirror of
https://github.com/python-kasa/python-kasa.git
synced 2026-10-07 05:13:49 +00:00
Discovery: accept cameras that only send the encrypt_type list (#1770)
Some checks failed
CI / Perform Lint Checks (3.14) (push) Has been cancelled
CI / Python 3.11 on macos-latest (push) Has been cancelled
CI / Python 3.12 on macos-latest (push) Has been cancelled
CI / Python 3.13 on macos-latest (push) Has been cancelled
CI / Python 3.14 on macos-latest (push) Has been cancelled
CI / Python 3.11 on ubuntu-latest (push) Has been cancelled
CI / Python 3.12 on ubuntu-latest (push) Has been cancelled
CI / Python 3.13 on ubuntu-latest (push) Has been cancelled
CI / Python 3.14 on ubuntu-latest (push) Has been cancelled
CI / Python 3.11 on windows-latest (push) Has been cancelled
CI / Python 3.12 on windows-latest (push) Has been cancelled
CI / Python 3.13 on windows-latest (push) Has been cancelled
CI / Python 3.14 on windows-latest (push) Has been cancelled
CodeQL Checks / Analyze (python) (push) Has been cancelled
Some checks failed
CI / Perform Lint Checks (3.14) (push) Has been cancelled
CI / Python 3.11 on macos-latest (push) Has been cancelled
CI / Python 3.12 on macos-latest (push) Has been cancelled
CI / Python 3.13 on macos-latest (push) Has been cancelled
CI / Python 3.14 on macos-latest (push) Has been cancelled
CI / Python 3.11 on ubuntu-latest (push) Has been cancelled
CI / Python 3.12 on ubuntu-latest (push) Has been cancelled
CI / Python 3.13 on ubuntu-latest (push) Has been cancelled
CI / Python 3.14 on ubuntu-latest (push) Has been cancelled
CI / Python 3.11 on windows-latest (push) Has been cancelled
CI / Python 3.12 on windows-latest (push) Has been cancelled
CI / Python 3.13 on windows-latest (push) Has been cancelled
CI / Python 3.14 on windows-latest (push) Has been cancelled
CodeQL Checks / Analyze (python) (push) Has been cancelled
The C460 on firmware 1.2.2 answers the UDP discovery with
`mgt_encrypt_schm: {"is_support_https": true}` and `encrypt_type:
["3"]`, but no `encrypt_type` inside the scheme and no `encrypt_info`.
`_get_connection_parameters` only looks at those two places for the
encryption type, so the camera ends up as "Unsupported device ... with
no encryption type" even though it works with the same AES login as
every other camera.
This uses the top level list as a last resort: when nothing else names
the encryption type, the device supports https and the list says 3,
treat it as AES.
Co-authored-by: freeKC <7538438+freeKC@users.noreply.github.com>
This commit is contained in:
@@ -831,6 +831,13 @@ class Discover:
|
||||
# Reuse the login_version attribute to pass the max to transport
|
||||
login_version = max([int(i) for i in et])
|
||||
|
||||
if not encrypt_type and encrypt_schm.is_support_https and login_version == 3:
|
||||
# Some camera firmwares (C460 1.2.2 for one) leave encrypt_type out
|
||||
# of mgt_encrypt_schm and send no encrypt_info, only the top level
|
||||
# encrypt_type list. "3" is the AES login that every other camera
|
||||
# reports as sym_schm AES.
|
||||
encrypt_type = DeviceEncryptionType.Aes.value
|
||||
|
||||
if not encrypt_type:
|
||||
raise UnsupportedDeviceError(
|
||||
f"Unsupported device {discovery_result.ip} of type {type_} "
|
||||
|
||||
Reference in New Issue
Block a user