Skip to main content

aioNanoleaf package

PyPI PyPI - Downloads PyPI - License

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())

Release files for aionanoleaf 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aionanoleaf 0.2.1
File Size Uploaded
aionanoleaf-0.2.1.tar.gz 23.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aionanoleaf 0.2.1
File Interpreter ABI Platform
aionanoleaf-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 50.9 kB

Release files / aionanoleaf-0.2.1.tar.gz

Download URL aionanoleaf-0.2.1.tar.gz
Size 23.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e00ef56546ab7ed4a6e0897e8b9c7b290da44406d477361bbf5d31d04c454265
BLAKE2b-256 checksum
How to use checksums
7eb15bc4116e8fdbd7aa8d1660f9a9dbe3a794f7acb50dbdb5588660345cc52e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.8

Release files / aionanoleaf-0.2.1-py3-none-any.whl

Download URL aionanoleaf-0.2.1-py3-none-any.whl
Size 27.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
34061b35d9b50b528cc135455b0897538a6e5bd69b0775b0393b043cbca87853
BLAKE2b-256 checksum
How to use checksums
56d8971cb2ff9163bcf9d0100ec383944db2f0168673e8eead2a069ef1be82e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.8

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page