{"id":24449,"library":"python-kasa","title":"python-kasa","description":"Python API for TP-Link Kasa and Tapo smart home devices. Version 0.10.2 supports bulbs, plugs, switches, hubs, cameras, robot vacuums, and more. Active development with frequent releases.","status":"active","version":"0.10.2","language":"python","source_language":"en","source_url":"https://github.com/python-kasa/python-kasa","tags":["kasa","tapo","tplink","smarthome","iot","async"],"install":[{"cmd":"pip install python-kasa","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Asynchronous HTTP client for Tapo protocol","package":"aiohttp","optional":false},{"reason":"Encryption used for Tapo device communication","package":"cryptography","optional":false}],"imports":[{"note":"Discover is exposed at the top-level kasa module since v0.4.0","wrong":"from kasa.discover import Discover","symbol":"Discover","correct":"from kasa import Discover"},{"note":"Device is exposed at the top-level kasa module","wrong":"from kasa.device import Device","symbol":"Device","correct":"from kasa import Device"},{"note":"SmartDevice is exported from kasa directly","wrong":"from kasa.smart import SmartDevice","symbol":"SmartDevice","correct":"from kasa import SmartDevice"}],"quickstart":{"code":"import asyncio\nfrom kasa import Discover, Credentials\n\nasync def main():\n    creds = Credentials(username='email@example.com', password='password123')\n    devices = await Discover.discover(credentials=creds)\n    for ip, dev in devices.items():\n        print(f'{ip}: {dev.alias} ({dev.model})')\n\nasyncio.run(main())","lang":"python","description":"Discover all Kasa/Tapo devices on the network using credentials."},"warnings":[{"fix":"Upgrade Python to 3.11 or later.","message":"Python 3.11 is now required (requires_python >=3.11). Python 3.9 and 3.10 no longer supported.","severity":"breaking","affected_versions":">=0.10.0"},{"fix":"Pass a `Credentials` object with email and password to `Discover.discover()`.","message":"Tapo cloud credentials are required for newer Tapo devices (Tapo protocol). Old Kasa devices may also need credentials depending on firmware. `Discover.discover()` with no credentials will find fewer devices.","severity":"breaking","affected_versions":">=0.7.0"},{"fix":"Wrap code in `async def main(): ... asyncio.run(main())`.","message":"Asynchronous API: all methods are async. You must use `asyncio.run()` or await inside an async context.","severity":"gotcha","affected_versions":"all"},{"fix":"Import from `kasa` directly: `from kasa import SmartDevice`.","message":"Direct import from `kasa.smart` or `kasa.iot` submodules is discouraged. Use top-level `kasa.SmartDevice` or `kasa.IotDevice` instead.","severity":"deprecated","affected_versions":">=0.8.0"},{"fix":"Upgrade to >=0.8.1.","message":"Device update may fail if a child device (e.g., plug on a hub) reports unsupported data. Ensure you run the latest version.","severity":"gotcha","affected_versions":"<0.8.1"}],"env_vars":null,"search_vec":"'0.10.2':17 'activ':28 'api':5 'async':38 'bulb':19 'camera':23 'develop':29 'devic':15 'frequent':31 'home':14 'hub':22 'iot':37 'kasa':3,10,33 'link':9 'plug':20 'python':2,4 'python-kasa':1 'releas':32 'robot':24 'smart':13 'smarthom':36 'support':18 'switch':21 'tapo':12,34 'tp':8 'tp-link':7 'tplink':35 'vacuum':25 'version':16","created_at":"2026-05-01T08:13:08.832950+00:00","updated_at":"2026-05-01T08:13:08.832950+00:00","problems":[{"fix":"Use `from kasa import Discover` and upgrade python-kasa: `pip install --upgrade python-kasa`.","cause":"Importing from a wrong location or using too old version (<0.4.0).","error":"AttributeError: module 'kasa' has no attribute 'Discover'"},{"fix":"Use `await` directly if already in async context, or use `nest_asyncio.apply()` for Jupyter.","cause":"Trying to run async code inside an already running loop (e.g., Jupyter or script already async).","error":"RuntimeError: asyncio.run() cannot be called from a running event loop"},{"fix":"Ensure credentials are correct and use an app password if 2FA is on. For some devices, use the local IP-based discovery without credentials.","cause":"Invalid credentials or Tapo account has two-factor authentication enabled.","error":"kasa.exceptions.SmartDeviceException: Authentication failed"},{"fix":"Verify device IP and network connectivity. Ensure you are on the same subnet.","cause":"Device not reachable on the network or firewall blocking.","error":"kasa.exceptions.TimeoutError: Timed out"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.10.2","cli_name":"kasa","cli_version":"kasa, version 0.10.2","type":"library","homepage":null,"github":"https://github.com/python-kasa/python-kasa","docs":"https://python-kasa.readthedocs.io","changelog":null,"pypi":"https://pypi.org/project/python-kasa/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["communication","http-networking"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}