diff --git a/kasa/device_factory.py b/kasa/device_factory.py index a9b5dcd7..c1679e15 100644 --- a/kasa/device_factory.py +++ b/kasa/device_factory.py @@ -6,6 +6,7 @@ import logging import time from typing import Any +from . import EncryptType from .device import Device from .device_type import DeviceType from .deviceconfig import DeviceConfig, DeviceFamily @@ -185,6 +186,7 @@ def get_protocol( the protocol/transport. For other device types the transport varies based on the discovery information. """ + _LOGGER.debug("Finding protocol for %s", config.host) ctype = config.connection_type protocol_name = ctype.device_family.value.split(".")[0] @@ -194,7 +196,11 @@ def get_protocol( if ctype.device_family is DeviceFamily.IotIpCamera: return IotProtocol(transport=LinkieTransportV2(config=config)) - if ctype.device_family is DeviceFamily.SmartTapoRobovac: + # Older FW used a different transport + if ( + ctype.device_family is DeviceFamily.SmartTapoRobovac + and ctype.encryption_type is EncryptType.Aes + ): return SmartProtocol(transport=SslTransport(config=config)) protocol_transport_key = ( @@ -212,6 +218,7 @@ def get_protocol( "IOT.KLAP": (IotProtocol, KlapTransport), "SMART.AES": (SmartProtocol, AesTransport), "SMART.KLAP": (SmartProtocol, KlapTransportV2), + "SMART.KLAP.HTTPS": (SmartProtocol, KlapTransportV2), # H200 is device family SMART.TAPOHUB and uses SmartCamProtocol so use # https to distuingish from SmartProtocol devices "SMART.AES.HTTPS": (SmartCamProtocol, SslAesTransport),