{"id":22929631,"url":"https://github.com/lawtancool/pycontrol4","last_synced_at":"2026-02-20T21:19:10.194Z","repository":{"id":41858515,"uuid":"270890973","full_name":"lawtancool/pyControl4","owner":"lawtancool","description":"Python 3 asyncio package for interacting with Control4 systems","archived":false,"fork":false,"pushed_at":"2024-09-01T21:44:11.000Z","size":251,"stargazers_count":40,"open_issues_count":3,"forks_count":17,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-05-23T15:33:32.796Z","etag":null,"topics":["control4","home-assistant"],"latest_commit_sha":null,"homepage":"https://lawtancool.github.io/pyControl4/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lawtancool.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-09T03:10:03.000Z","updated_at":"2025-01-12T12:25:15.000Z","dependencies_parsed_at":"2025-01-05T02:08:32.594Z","dependency_job_id":"1e8e7c60-1dc6-4b8b-bc4a-90970fdb8377","html_url":"https://github.com/lawtancool/pyControl4","commit_stats":{"total_commits":193,"total_committers":10,"mean_commits":19.3,"dds":0.3212435233160622,"last_synced_commit":"8f96a17069e431fe4d42d542f0e8d338cbf31b35"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/lawtancool/pyControl4","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lawtancool%2FpyControl4","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lawtancool%2FpyControl4/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lawtancool%2FpyControl4/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lawtancool%2FpyControl4/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lawtancool","download_url":"https://codeload.github.com/lawtancool/pyControl4/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lawtancool%2FpyControl4/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260005991,"owners_count":22944867,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["control4","home-assistant"],"created_at":"2024-12-14T10:15:36.809Z","updated_at":"2026-02-20T21:19:10.186Z","avatar_url":"https://github.com/lawtancool.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pyControl4\n[![PyPI version](https://badge.fury.io/py/pyControl4.svg)](https://badge.fury.io/py/pyControl4)[![Downloads](https://pepy.tech/badge/pycontrol4)](https://pepy.tech/project/pycontrol4)\n\n[![CI](https://github.com/lawtancool/pyControl4/workflows/CI/badge.svg)](https://github.com/lawtancool/pyControl4/actions?query=workflow%3ACI)[![pdoc](https://github.com/lawtancool/pyControl4/workflows/pdoc/badge.svg)](https://github.com/lawtancool/pyControl4/actions?query=workflow%3Apdoc)[![PyPI Release](https://github.com/lawtancool/pyControl4/workflows/PyPI%20Release/badge.svg)](https://github.com/lawtancool/pyControl4/actions?query=workflow%3A%22PyPI+Release%22)\n\n\nAn asynchronous library to interact with Control4 systems through their built-in REST API. This is known to work on controllers with OS 2.10.1.544795-res and OS 3.0+. \n\nAuto-generated function documentation can be found at \u003chttps://lawtancool.github.io/pyControl4\u003e\n\nFor those who are looking for a pre-built solution for controlling their devices, this library is implemented in the [official Home Assistant Control4 integration](https://www.home-assistant.io/integrations/control4/).\n\n## Usage example\n```python\nfrom pyControl4.account import C4Account\nfrom pyControl4.director import C4Director\nfrom pyControl4.light import C4Light\nimport asyncio\n\nusername = \"\"\npassword = \"\"\n\nip = \"192.168.1.25\"\n\n\"\"\"Authenticate with Control4 account\"\"\"\naccount = C4Account(username, password)\nasyncio.run(account.get_account_bearer_token())\n\n\"\"\"Get and print controller name\"\"\"\naccount_controllers = asyncio.run(account.get_account_controllers())\nprint(account_controllers[\"controllerCommonName\"])\n\n\"\"\"Get bearer token to communicate with controller locally\"\"\"\ndirector_bearer_token = asyncio.run(\n    account.get_director_bearer_token(account_controllers[\"controllerCommonName\"])\n)[\"token\"]\n\n\"\"\"Create new C4Director instance\"\"\"\ndirector = C4Director(ip, director_bearer_token)\n\n\"\"\"Print all devices on the controller\"\"\"\nprint(asyncio.run(director.get_all_item_info()))\n\n\"\"\"Create new C4Light instance\"\"\"\nlight = C4Light(director, 253)\n\n\"\"\"Ramp light level to 10% over 10000ms\"\"\"\nasyncio.run(light.ramp_to_level(10, 10000))\n\n\"\"\"Print state of light\"\"\"\nprint(asyncio.run(light.get_state()))\n```\n\n## Contributing\nPull requests are welcome! Please lint your Python code with `flake8` and format it with [Black](https://pypi.org/project/black/).\n\n## Disclaimer\nThis library is not affiliated with or endorsed by Control4. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flawtancool%2Fpycontrol4","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flawtancool%2Fpycontrol4","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flawtancool%2Fpycontrol4/lists"}