aionanoleaf


Nameaionanoleaf JSON
Version 0.2.1 PyPI version JSON
download
home_pagehttps://github.com/milanmeu/aionanoleaf
SummaryAsync Python package for the Nanoleaf API
upload_time2022-12-09 14:11:29
maintainer
docs_urlNone
authorMilan Meulemans
requires_python>=3.8
licenseLGPLv3+
keywords nanoleaf api canvas shapes elements light panels
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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": "aionanoleaf",
    "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/7e/b1/5bc4116e8fdbd7aa8d1660f9a9dbe3a794f7acb50dbdb5588660345cc52e/aionanoleaf-0.2.1.tar.gz",
    "platform": null,
    "description": "# aioNanoleaf package \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)\n\nAn async Python wrapper for the Nanoleaf API.\n\n## Installation\n```bash\npip install aionanoleaf\n```\n\n## Usage\n### Import\n```python\nfrom aionanoleaf import Nanoleaf\n```\n\n### Create a `aiohttp.ClientSession` to make requests\n```python\nfrom aiohttp import ClientSession\nsession = ClientSession()\n```\n\n### Create a `Nanoleaf` instance\n```python\nfrom aionanoleaf import Nanoleaf\nlight = Nanoleaf(session, \"192.168.0.100\")\n```\n\n## Example\n```python\nfrom aiohttp import ClientSession\nfrom asyncio import run\n\nimport aionanoleaf\n\nasync def main():\n    async with ClientSession() as session:\n        nanoleaf = aionanoleaf.Nanoleaf(session, \"192.168.0.73\")\n        try:\n            await nanoleaf.authorize()\n        except aionanoleaf.Unauthorized as ex:\n            print(\"Not authorizing new tokens:\", ex)\n            return\n        await nanoleaf.turn_on()\n        await nanoleaf.get_info()\n        print(\"Brightness:\", nanoleaf.brightness)\n        await nanoleaf.deauthorize()\nrun(main())\n```\n",
    "bugtrack_url": null,
    "license": "LGPLv3+",
    "summary": "Async Python package for the Nanoleaf API",
    "version": "0.2.1",
    "split_keywords": [
        "nanoleaf",
        "api",
        "canvas",
        "shapes",
        "elements",
        "light",
        "panels"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "79883c3f56586c3f45fd9066d6b18b5d",
                "sha256": "34061b35d9b50b528cc135455b0897538a6e5bd69b0775b0393b043cbca87853"
            },
            "downloads": -1,
            "filename": "aionanoleaf-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "79883c3f56586c3f45fd9066d6b18b5d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 27140,
            "upload_time": "2022-12-09T14:11:21",
            "upload_time_iso_8601": "2022-12-09T14:11:21.550647Z",
            "url": "https://files.pythonhosted.org/packages/56/d8/971cb2ff9163bcf9d0100ec383944db2f0168673e8eead2a069ef1be82e6/aionanoleaf-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "0abb696268c0993197be34ce3c6f42ef",
                "sha256": "e00ef56546ab7ed4a6e0897e8b9c7b290da44406d477361bbf5d31d04c454265"
            },
            "downloads": -1,
            "filename": "aionanoleaf-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "0abb696268c0993197be34ce3c6f42ef",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 23760,
            "upload_time": "2022-12-09T14:11:29",
            "upload_time_iso_8601": "2022-12-09T14:11:29.534324Z",
            "url": "https://files.pythonhosted.org/packages/7e/b1/5bc4116e8fdbd7aa8d1660f9a9dbe3a794f7acb50dbdb5588660345cc52e/aionanoleaf-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-09 14:11:29",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "milanmeu",
    "github_project": "aionanoleaf",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "aionanoleaf"
}
        
Elapsed time: 0.01654s