Changes Summary
- Now uses kasa-python for transfer and encryption layer, this unifies the code into 1 place, addressing future devices firmware updates more efficiently
Breaking changes
- Removed legacy HTTP/TLS auth path and helper methods from
pytapo/__init__.py(request,refreshStok,isSecureConnection,validateDeviceConfirm,getTag,generateEncryptionToken,getHashedPassword,encryptRequest,decryptResponse,getHostURL); external callers of these now break. - Deleted
pytapo/TlsAdapter.py; any direct imports ofpytapo.TlsAdapterwill fail. - Raw payloads for
performRequest/executeFunctionon non‑KLAP devices now must follow python‑kasa smart‑camera protocol shapes (get/set/do/multipleRequest) rather than legacy{"method": "...", "params": ...}; custom callers using the old shape must update. Example:
Previously:
self.performRequest(
{"method": "do", "cloud_config": {"fw_download": "null"}}
)
Now:
self.performRequest({"do": {"cloud_config": {"fw_download": "null"}}})
- Legacy auth/session attributes are no longer set on
Tapoinstances (stok,seq,lsk,cnonce,ivb,passwordEncryptionMethod,retryStok), which can break code that accessed them.
Potentially Breaking Behavior
- Non‑KLAP communication now goes through python‑kasa discovery + protocol query, replacing direct HTTP; error types/messages and retry behavior differ.
- Media/session encryption selection now derives from KLAP status or python‑kasa connection
login_version(defaulting to SHA256 when unknown), which may change behavior for devices that previously negotiated MD5.
Other Changes
- Major refactor in
pytapo/__init__.pyto manage python‑kasa device lifecycle (Discover.discover_single,dev.update, cacheddevand_kasa_ready) and a dedicated asyncio loop to keep aiohttp sessions alive between calls. - Added kasa warning handler + connection debug logging to capture unknown error codes and map them through
ERROR_CODES. - Improved error handling for device‑blocked scenarios and normalized child‑device response handling.
- Updated many request builders to the new payload shapes (OSD, module spec, audio, motor, firmware,
getMost, etc.) for non‑KLAP devices.
Version
pytapo/version.pybumped from3.3.56to3.4.0.