Initial TapoCamera support (#1165)

Adds experimental support for the Tapo Camera protocol also used by the H200 hub.
Creates a new SslAesTransport and a derived SmartCamera and SmartCameraProtocol.
This commit is contained in:
Steven B.
2024-10-16 16:53:52 +01:00
committed by GitHub
parent 380fbb93c3
commit dcc36e1dfe
13 changed files with 770 additions and 11 deletions

View File

@@ -72,6 +72,7 @@ class DeviceFamily(Enum):
SmartTapoSwitch = "SMART.TAPOSWITCH"
SmartTapoHub = "SMART.TAPOHUB"
SmartKasaHub = "SMART.KASAHUB"
SmartIpCamera = "SMART.IPCAMERA"
def _dataclass_from_dict(klass, in_val):
@@ -118,19 +119,24 @@ class DeviceConnectionParameters:
device_family: DeviceFamily
encryption_type: DeviceEncryptionType
login_version: Optional[int] = None
https: bool = False
@staticmethod
def from_values(
device_family: str,
encryption_type: str,
login_version: Optional[int] = None,
https: Optional[bool] = None,
) -> "DeviceConnectionParameters":
"""Return connection parameters from string values."""
try:
if https is None:
https = False
return DeviceConnectionParameters(
DeviceFamily(device_family),
DeviceEncryptionType(encryption_type),
login_version,
https,
)
except (ValueError, TypeError) as ex:
raise KasaException(