mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-10-11 18:08:02 +00:00
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:
@@ -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(
|
||||
|
Reference in New Issue
Block a user