mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-09 20:24:02 +00:00
Move TAPO smartcamera out of experimental package (#1255)
Co-authored-by: Teemu R. <tpr@iki.fi>
This commit is contained in:
@@ -10,9 +10,6 @@ from .device import Device
|
||||
from .device_type import DeviceType
|
||||
from .deviceconfig import DeviceConfig
|
||||
from .exceptions import KasaException, UnsupportedDeviceError
|
||||
from .experimental.smartcamera import SmartCamera
|
||||
from .experimental.smartcameraprotocol import SmartCameraProtocol
|
||||
from .experimental.sslaestransport import SslAesTransport
|
||||
from .iot import (
|
||||
IotBulb,
|
||||
IotDevice,
|
||||
@@ -27,7 +24,9 @@ from .protocols import (
|
||||
IotProtocol,
|
||||
SmartProtocol,
|
||||
)
|
||||
from .protocols.smartcameraprotocol import SmartCameraProtocol
|
||||
from .smart import SmartDevice
|
||||
from .smartcamera.smartcamera import SmartCamera
|
||||
from .transports import (
|
||||
AesTransport,
|
||||
BaseTransport,
|
||||
@@ -35,6 +34,7 @@ from .transports import (
|
||||
KlapTransportV2,
|
||||
XorTransport,
|
||||
)
|
||||
from .transports.sslaestransport import SslAesTransport
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
@@ -217,12 +217,9 @@ def get_protocol(
|
||||
"IOT.KLAP": (IotProtocol, KlapTransport),
|
||||
"SMART.AES": (SmartProtocol, AesTransport),
|
||||
"SMART.KLAP": (SmartProtocol, KlapTransportV2),
|
||||
"SMART.AES.HTTPS": (SmartCameraProtocol, SslAesTransport),
|
||||
}
|
||||
if not (prot_tran_cls := supported_device_protocols.get(protocol_transport_key)):
|
||||
from .experimental import Experimental
|
||||
|
||||
if Experimental.enabled() and protocol_transport_key == "SMART.AES.HTTPS":
|
||||
prot_tran_cls = (SmartCameraProtocol, SslAesTransport)
|
||||
else:
|
||||
return None
|
||||
return prot_tran_cls[0](transport=prot_tran_cls[1](config=config))
|
||||
return None
|
||||
protocol_cls, transport_cls = prot_tran_cls
|
||||
return protocol_cls(transport=transport_cls(config=config))
|
||||
|
@@ -55,9 +55,9 @@ from .modulemapping import ModuleName
|
||||
if TYPE_CHECKING:
|
||||
from . import interfaces
|
||||
from .device import Device
|
||||
from .experimental import modules as experimental
|
||||
from .iot import modules as iot
|
||||
from .smart import modules as smart
|
||||
from .smartcamera import modules as smartcamera
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
@@ -133,7 +133,7 @@ class Module(ABC):
|
||||
TriggerLogs: Final[ModuleName[smart.TriggerLogs]] = ModuleName("TriggerLogs")
|
||||
|
||||
# SMARTCAMERA only modules
|
||||
Camera: Final[ModuleName[experimental.Camera]] = ModuleName("Camera")
|
||||
Camera: Final[ModuleName[smartcamera.Camera]] = ModuleName("Camera")
|
||||
|
||||
def __init__(self, device: Device, module: str) -> None:
|
||||
self._device = device
|
||||
|
@@ -14,12 +14,12 @@ from ..exceptions import (
|
||||
_RetryableError,
|
||||
)
|
||||
from ..json import dumps as json_dumps
|
||||
from ..protocols import SmartProtocol
|
||||
from .sslaestransport import (
|
||||
from ..transports.sslaestransport import (
|
||||
SMART_AUTHENTICATION_ERRORS,
|
||||
SMART_RETRYABLE_ERRORS,
|
||||
SmartErrorCode,
|
||||
)
|
||||
from . import SmartProtocol
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
5
kasa/smartcamera/__init__.py
Normal file
5
kasa/smartcamera/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
"""Package for supporting tapo-branded cameras."""
|
||||
|
||||
from .smartcamera import SmartCamera
|
||||
|
||||
__all__ = ["SmartCamera"]
|
@@ -7,11 +7,10 @@ from typing import Any
|
||||
|
||||
from ..device_type import DeviceType
|
||||
from ..module import Module
|
||||
from ..protocols.smartcameraprotocol import _ChildCameraProtocolWrapper
|
||||
from ..smart import SmartChildDevice, SmartDevice
|
||||
from .modules.childdevice import ChildDevice
|
||||
from .modules.device import DeviceModule
|
||||
from .modules import ChildDevice, DeviceModule
|
||||
from .smartcameramodule import SmartCameraModule
|
||||
from .smartcameraprotocol import _ChildCameraProtocolWrapper
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
@@ -27,7 +27,7 @@ from ..exceptions import (
|
||||
from ..httpclient import HttpClient
|
||||
from ..json import dumps as json_dumps
|
||||
from ..json import loads as json_loads
|
||||
from ..transports import AesEncyptionSession, BaseTransport
|
||||
from . import AesEncyptionSession, BaseTransport
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
Reference in New Issue
Block a user