8000 Move TAPO smartcamera out of experimental package (#1255) · ryenitcher/python-kasa@6213b90 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6213b90

Browse files
sdb9696rytilahti
andauthored
Move TAPO smartcamera out of experimental package (python-kasa#1255)
Co-authored-by: Teemu R. <tpr@iki.fi>
1 parent e55731c commit 6213b90

21 files changed

+59
-36
lines changed

devtools/dump_devinfo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
from kasa.deviceconfig import DeviceEncryptionType, DeviceFamily
4141
from kasa.discover import DiscoveryResult
4242
from kasa.exceptions import SmartErrorCode
43-
from kasa.experimental.smartcameraprotocol import (
43+
from kasa.protocols.smartcameraprotocol import (
4444
SmartCameraProtocol,
4545
_ChildCameraProtocolWrapper,
4646
)

kasa/device_factory.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
from .device_type import DeviceType
1111
from .deviceconfig import DeviceConfig
1212
from .exceptions import KasaException, UnsupportedDeviceError
13-
from .experimental.smartcamera import SmartCamera
14-
from .experimental.smartcameraprotocol import SmartCameraProtocol
15-
from .experimental.sslaestransport import SslAesTransport
1613
from .iot import (
1714
IotBulb,
1815
IotDevice,
@@ -27,14 +24,17 @@
2724
IotProtocol,
2825
SmartProtocol,
2926
)
27+
from .protocols.smartcameraprotocol import SmartCameraProtocol
3028
from .smart import SmartDevice
29+
from .smartcamera.smartcamera import SmartCamera
3130
from .transports import (
3231
AesTransport,
3332
BaseTransport,
3433
KlapTransport,
3534
KlapTransportV2,
3635
XorTransport,
3736
)
37+
from .transports.sslaestransport import SslAesTransport
3838

3939
_LOGGER = logging.getLogger(__name__)
4040

@@ -217,12 +217,9 @@ def get_protocol(
217217
"IOT.KLAP": (IotProtocol, KlapTransport),
218218
"SMART.AES": (SmartProtocol, AesTransport),
219219
"SMART.KLAP": (SmartProtocol, KlapTransportV2),
220+
"SMART.AES.HTTPS": (SmartCameraProtocol, SslAesTransport),
220221
}
221222
if not (prot_tran_cls := supported_device_protocols.get(protocol_transport_key)):
222-
from .experimental import Experimental
223-
224-
if Experimental.enabled() and protocol_transport_key == "SMART.AES.HTTPS":
225-
prot_tran_cls = (SmartCameraProtocol, SslAesTransport)
226-
else:
227-
return None
228-
return prot_tran_cls[0](transport=prot_tran_cls[1](config=config))
223+
return None
224+
protocol_cls, transport_cls = prot_tran_cls
225+
return protocol_cls(transport=transport_cls(config=config))

kasa/module.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@
5555
if TYPE_CHECKING:
5656
from . import interfaces
5757
from .device import Device
58-
from .experimental import modules as experimental
5958
from .iot import modules as iot
6059
from .smart import modules as smart
60+
from .smartcamera import modules as smartcamera
6161

6262
_LOGGER = logging.getLogger(__name__)
6363

@@ -133,7 +133,7 @@ class Module(ABC):
133133
TriggerLogs: Final[ModuleName[smart.TriggerLogs]] = ModuleName("TriggerLogs")
134134

135135
# SMARTCAMERA only modules
136-
Camera: Final[ModuleName[experimental.Camera]] = ModuleName("Camera")
136+
Camera: Final[ModuleName[smartcamera.Camera]] = ModuleName("Camera")
137137

138138
def __init__(self, device: Device, module: str) -> None:
139139
self._device = device

kasa/experimental/smartcameraprotocol.py renamed to kasa/protocols/smartcameraprotocol.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
_RetryableError,
1515
)
1616
from ..json import dumps as json_dumps
17-
from ..protocols import SmartProtocol
18-
from .sslaestransport import (
17+
from ..transports.sslaestransport import (
1918
SMART_AUTHENTICATION_ERRORS,
2019
SMART_RETRYABLE_ERRORS,
2120
SmartErrorCode,
2221
)
22+
from . import SmartProtocol
2323

2424
_LOGGER = logging.getLogger(__name__)
2525

kasa/smartcamera/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"""Package for supporting tapo-branded cameras."""
2+
3+
from .smartcamera import SmartCamera
4+
5+
__all__ = ["SmartCamera"]
File renamed without changes.

0 commit comments

Comments
 (0)
0