Async Python package for the Nanoleaf API
Project description
aioNanoleaf package
An async Python wrapper for the Nanoleaf API.
Installation
pip install aionanoleaf
Usage
Import
from aionanoleaf import Nanoleaf
Create a aiohttp.ClientSession to make requests
from aiohttp import ClientSession
session = ClientSession()
Create a Nanoleaf instance
from aionanoleaf import Nanoleaf
light = Nanoleaf(session, "192.168.0.100")
Example
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())
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aionanoleaf-0.0.3.tar.gz
(19.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aionanoleaf-0.0.3.tar.gz.
File metadata
- Download URL: aionanoleaf-0.0.3.tar.gz
- Upload date:
- Size: 19.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f83a97cf594f14aab46961210d1aa8ce105f8454422199222daba1446445e7a
|
|
| MD5 |
4d211b0943acfe94f2b5e9fdaef90bca
|
|
| BLAKE2b-256 |
47a3ba3b62616d44f9f461a2058799a4e6edcfd5a8e6c14d50b8030c6da6d946
|
File details
Details for the file aionanoleaf-0.0.3-py3-none-any.whl.
File metadata
- Download URL: aionanoleaf-0.0.3-py3-none-any.whl
- Upload date:
- Size: 22.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a3136b55af4c52d7ccff4c1bf765a41b19bae90c2d34b2377e2a32739e0c7f2
|
|
| MD5 |
0d3a7d717a34105a298a7f675e84a102
|
|
| BLAKE2b-256 |
762ad08565d75055e42f4df14cc03bd54ea87f98e502549e67fecd5702ef28d7
|