# aioNanoleaf package
[![PyPI](https://img.shields.io/pypi/v/aionanoleaf)](https://pypi.org/project/aionanoleaf/) ![PyPI - Downloads](https://img.shields.io/pypi/dm/aionanoleaf) [![PyPI - License](https://img.shields.io/pypi/l/aionanoleaf?color=blue)](https://github.com/milanmeu/aionanoleaf/blob/main/COPYING)
An async Python wrapper for the Nanoleaf API.
## Installation
```bash
pip install aionanoleaf
```
## Usage
### Import
```python
from aionanoleaf import Nanoleaf
```
### Create a `aiohttp.ClientSession` to make requests
```python
from aiohttp import ClientSession
session = ClientSession()
```
### Create a `Nanoleaf` instance
```python
from aionanoleaf import Nanoleaf
light = Nanoleaf(session, "192.168.0.100")
```
## Example
```python
from aiohttp import ClientSession
from asyncio import run
import aionanoleaf
async def main():
async with ClientSession() as session:
nanoleaf = aionanoleaf.Nanoleaf(session, "192.168.0.73")
try:
await nanoleaf.authorize()
except aionanoleaf.Unauthorized as ex:
print("Not authorizing new tokens:", ex)
return
await nanoleaf.turn_on()
await nanoleaf.get_info()
print("Brightness:", nanoleaf.brightness)
await nanoleaf.deauthorize()
run(main())
```
Raw data
{
"_id": null,
"home_page": "https://github.com/milanmeu/aionanoleaf",
"name": "aionanoleaf4d",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "nanoleaf api canvas shapes elements light panels",
"author": "Milan Meulemans",
"author_email": "milan.meulemans@live.be",
"download_url": "https://files.pythonhosted.org/packages/bc/0d/57aa44999ff7f8f62cd02132aa9a6ca4c2ef7d27985e747d7723fcf67b93/aionanoleaf4d-0.2.4.tar.gz",
"platform": null,
"description": "# aioNanoleaf package \r\n[![PyPI](https://img.shields.io/pypi/v/aionanoleaf)](https://pypi.org/project/aionanoleaf/) ![PyPI - Downloads](https://img.shields.io/pypi/dm/aionanoleaf) [![PyPI - License](https://img.shields.io/pypi/l/aionanoleaf?color=blue)](https://github.com/milanmeu/aionanoleaf/blob/main/COPYING)\r\n\r\nAn async Python wrapper for the Nanoleaf API.\r\n\r\n## Installation\r\n```bash\r\npip install aionanoleaf\r\n```\r\n\r\n## Usage\r\n### Import\r\n```python\r\nfrom aionanoleaf import Nanoleaf\r\n```\r\n\r\n### Create a `aiohttp.ClientSession` to make requests\r\n```python\r\nfrom aiohttp import ClientSession\r\nsession = ClientSession()\r\n```\r\n\r\n### Create a `Nanoleaf` instance\r\n```python\r\nfrom aionanoleaf import Nanoleaf\r\nlight = Nanoleaf(session, \"192.168.0.100\")\r\n```\r\n\r\n## Example\r\n```python\r\nfrom aiohttp import ClientSession\r\nfrom asyncio import run\r\n\r\nimport aionanoleaf\r\n\r\nasync def main():\r\n async with ClientSession() as session:\r\n nanoleaf = aionanoleaf.Nanoleaf(session, \"192.168.0.73\")\r\n try:\r\n await nanoleaf.authorize()\r\n except aionanoleaf.Unauthorized as ex:\r\n print(\"Not authorizing new tokens:\", ex)\r\n return\r\n await nanoleaf.turn_on()\r\n await nanoleaf.get_info()\r\n print(\"Brightness:\", nanoleaf.brightness)\r\n await nanoleaf.deauthorize()\r\nrun(main())\r\n```\r\n",
"bugtrack_url": null,
"license": "LGPLv3+",
"summary": "Async Python package for the Nanoleaf API and adds basic support for Nanoleaf 4D",
"version": "0.2.4",
"project_urls": {
"Bug Tracker": "https://github.com/milanmeu/aionanoleaf/issues",
"Documentation": "https://github.com/milanmeu/aionanoleaf/blob/main/README.md",
"Homepage": "https://github.com/milanmeu/aionanoleaf",
"Say Thanks!": "https://saythanks.io/to/milan.meulemans@live.be",
"Source Code": "https://github.com/milanmeu/aionanoleaf"
},
"split_keywords": [
"nanoleaf",
"api",
"canvas",
"shapes",
"elements",
"light",
"panels"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "eedced1b79a08592990cca763eb9f32959ddc92c9b65364744419a086ed7e7af",
"md5": "e7435030a5b4c2dec7b6d4df9444ca02",
"sha256": "f5f60576f9bed0efa44b98662c602291c3a5bb713ab1b9c86468078bbe6daf3b"
},
"downloads": -1,
"filename": "aionanoleaf4d-0.2.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e7435030a5b4c2dec7b6d4df9444ca02",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 28365,
"upload_time": "2024-03-05T18:24:11",
"upload_time_iso_8601": "2024-03-05T18:24:11.077649Z",
"url": "https://files.pythonhosted.org/packages/ee/dc/ed1b79a08592990cca763eb9f32959ddc92c9b65364744419a086ed7e7af/aionanoleaf4d-0.2.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "bc0d57aa44999ff7f8f62cd02132aa9a6ca4c2ef7d27985e747d7723fcf67b93",
"md5": "607deeaa5f3d73ce51cdf85cb4fb87ea",
"sha256": "38c0c98a927a0ce051f9417c1642f3ad729b0fbfb43ec1673fc45a0ed8b8b2ae"
},
"downloads": -1,
"filename": "aionanoleaf4d-0.2.4.tar.gz",
"has_sig": false,
"md5_digest": "607deeaa5f3d73ce51cdf85cb4fb87ea",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 24774,
"upload_time": "2024-03-05T18:24:12",
"upload_time_iso_8601": "2024-03-05T18:24:12.100748Z",
"url": "https://files.pythonhosted.org/packages/bc/0d/57aa44999ff7f8f62cd02132aa9a6ca4c2ef7d27985e747d7723fcf67b93/aionanoleaf4d-0.2.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-05 18:24:12",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "milanmeu",
"github_project": "aionanoleaf",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "aionanoleaf4d"
}