mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-23 03:33:35 +00:00
Merge remote-tracking branch 'upstream/master' into feat/smartcam_passthrough
This commit is contained in:
commit
b291713c00
@ -179,7 +179,12 @@ def get_device_class_from_family(
|
|||||||
def get_protocol(
|
def get_protocol(
|
||||||
config: DeviceConfig,
|
config: DeviceConfig,
|
||||||
) -> BaseProtocol | None:
|
) -> BaseProtocol | None:
|
||||||
"""Return the protocol from the connection name."""
|
"""Return the protocol from the connection name.
|
||||||
|
|
||||||
|
For cameras and vacuums the device family is a simple mapping to
|
||||||
|
the protocol/transport. For other device types the transport varies
|
||||||
|
based on the discovery information.
|
||||||
|
"""
|
||||||
ctype = config.connection_type
|
ctype = config.connection_type
|
||||||
protocol_name = ctype.device_family.value.split(".")[0]
|
protocol_name = ctype.device_family.value.split(".")[0]
|
||||||
|
|
||||||
@ -207,8 +212,8 @@ def get_protocol(
|
|||||||
"IOT.KLAP": (IotProtocol, KlapTransport),
|
"IOT.KLAP": (IotProtocol, KlapTransport),
|
||||||
"SMART.AES": (SmartProtocol, AesTransport),
|
"SMART.AES": (SmartProtocol, AesTransport),
|
||||||
"SMART.KLAP": (SmartProtocol, KlapTransportV2),
|
"SMART.KLAP": (SmartProtocol, KlapTransportV2),
|
||||||
# Still require a lookup for SslAesTransport as H200 has a type of
|
# H200 is device family SMART.TAPOHUB and uses SmartCamProtocol so use
|
||||||
# SMART.TAPOHUB.
|
# https to distuingish from SmartProtocol devices
|
||||||
"SMART.AES.HTTPS": (SmartCamProtocol, SslAesTransport),
|
"SMART.AES.HTTPS": (SmartCamProtocol, SslAesTransport),
|
||||||
}
|
}
|
||||||
if not (prot_tran_cls := supported_device_protocols.get(protocol_transport_key)):
|
if not (prot_tran_cls := supported_device_protocols.get(protocol_transport_key)):
|
||||||
|
@ -850,6 +850,8 @@ class Discover:
|
|||||||
if not (login_version := encrypt_schm.lv) and (
|
if not (login_version := encrypt_schm.lv) and (
|
||||||
et := discovery_result.encrypt_type
|
et := discovery_result.encrypt_type
|
||||||
):
|
):
|
||||||
|
# Known encrypt types are ["1","2"] and ["3"]
|
||||||
|
# Reuse the login_version attribute to pass the max to transport
|
||||||
login_version = max([int(i) for i in et])
|
login_version = max([int(i) for i in et])
|
||||||
|
|
||||||
if not encrypt_type:
|
if not encrypt_type:
|
||||||
|
Loading…
Reference in New Issue
Block a user