github JurajNyiri/pytapo 3.4.0

latest releases: 3.4.18, 3.4.17, 3.4.16...
6 months ago

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 of pytapo.TlsAdapter will fail.
  • Raw payloads for performRequest/executeFunction on 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 Tapo instances (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__.py to manage python‑kasa device lifecycle (Discover.discover_single, dev.update, cached dev and _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.py bumped from 3.3.56 to 3.4.0.

Don't miss a new pytapo release

NewReleases is sending notifications on new releases.