Async Python package for the Nanoleaf API with basic 4d support
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aionanoleaf4d-0.2.2.tar.gz
(24.6 kB
view hashes)
Built Distribution
Close
Hashes for aionanoleaf4d-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06306810f1e8882cb93656a8ddf9a52f0b6e8626078439103ba6219c0f55c801 |
|
MD5 | bc5a1fe17dec0a42c8207a10427761a5 |
|
BLAKE2b-256 | 59de6b7ffb6c573afff63f89a1f7fd1e7fec473b2ee34d17a4e1ac9f65ea89a6 |