Merge remote-tracking branch 'upstream/master' into feat/smartcam_passthrough

This commit is contained in:
Steven B 2024-12-17 07:41:35 +00:00
commit b291713c00
No known key found for this signature in database
GPG Key ID: 6D5B46B3679F2A43
2 changed files with 10 additions and 3 deletions

View File

@ -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)):

View File

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