{"id":23223,"library":"aiounifi","title":"aiounifi","description":"aiounifi is an asynchronous Python library for communicating with the UniFi Network Controller API. It provides a clean async interface for managing UniFi devices, clients, and settings. The current version is 90, requiring Python >=3.13.0, with active development and frequent releases.","status":"active","version":"90","language":"python","source_language":"en","source_url":"https://github.com/daxtens/aiounifi","tags":["unifi","ubiquiti","async","network-controller","api"],"install":[{"cmd":"pip install aiounifi","lang":"bash","label":"Install aiounifi"}],"dependencies":[{"reason":"Async HTTP client for API requests","package":"aiohttp","optional":false}],"imports":[{"note":"Controller is exported from the top-level package since v45","wrong":"from aiounifi.controller import Controller","symbol":"Controller","correct":"from aiounifi import Controller"},{"note":"Site model class is available at top-level since v60","wrong":"from aiounifi.models.site import Site","symbol":"Site","correct":"from aiounifi import Site"}],"quickstart":{"code":"import asyncio\nfrom aiounifi import Controller\n\nasync def main():\n    controller = Controller(\n        host=\"192.168.1.1\",\n        username=\"admin\",\n        password=\"password\",\n        port=8443,\n        ssl_verify=False\n    )\n    await controller.initialize()\n    sites = await controller.get_sites()\n    print(sites)\n    await controller.close()\n\nasyncio.run(main())","lang":"python","description":"Connect to a UniFi controller and list sites."},"warnings":[{"fix":"Replace `await controller.login()` with `await controller.initialize()`.","message":"The method `controller.login()` is deprecated since v71; use `controller.initialize()` which automatically authenticates.","severity":"deprecated","affected_versions":">=71"},{"fix":"Set `ssl_verify=False` in Controller constructor or provide a valid SSL context.","message":"SSL verification is enabled by default (since v65). Many local controllers use self-signed certificates, causing SSL errors.","severity":"gotcha","affected_versions":">=65"},{"fix":"Upgrade Python to 3.13 or higher, or pin aiounifi to <88.","message":"Python 3.12 support dropped; requires Python >=3.13 as of version 88.","severity":"breaking","affected_versions":">=88"},{"fix":"Access client attributes like `client.name` instead of `client['name']`.","message":"The `get_clients()` method returns a list of `Client` objects, not raw dicts (changed in v50).","severity":"gotcha","affected_versions":">=50"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Ensure username/password are correct and call `await controller.initialize()` to re-authenticate.","cause":"Invalid credentials or session expired.","error":"aiounifi.exceptions.Unauthorized"},{"fix":"Check controller IP and port; if using default HTTPS port (8443), ensure it's correct.","cause":"Wrong host or port, or network unreachable.","error":"aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 192.168.1.1:8443 ssl:default [getaddrinfo failed]"},{"fix":"Use `controller.initialize()` instead of `controller.login()`.","cause":"Code uses deplicated `login()` method removed in newer versions.","error":"AttributeError: 'Controller' object has no attribute 'login'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}