Skip to main content

A Python module for the coolest lights with the worst software support.

This module aims to do more than just act as a wrapper for API calls. It provides several convenience functions to perform more complicated and robust actions than are possible in some of the other Aurora wrappers I’ve seen. For instance, being able to switch to a random new effect, or toggle the on/off state with a single command.

Support The Project

This is a pet project, and I’m doing it because I need API support just as badly as you do. But, if it really does make your life better, I’d appreciate a cup of coffee.

BTC: 1Gr31rgb6UXEdXwbwQGUsadcd7AnY7okXT
LTC: Lajqnm28UipLbzJqvyy4tRQFf39xQy6B48

Install

It’s super easy - just use pip to get the latest version.

pip install nanoleaf --upgrade

Setup

There are two pieces of information you’ll need to control your Aurora: The IP address and an auth token.

Finding IP Address

For most people, the IP address that the Aurora uses to communicate is the one assigned by your router, but this might not necessarily be true depending on your network setup. Either way, you can get this by using the setup class. After about 90 seconds, this will return a list of the IP address of every Aurora found on the network.

from nanoleaf import setup

ipAddressList = setup.find_auroras()

Generate Auth Token

To generate an auth token, you must first press and hold the power button on the Aurora for about 5-7 seconds, until the white LED flashes briefly. Then, call the Setup class like so:

from nanoleaf import setup

token = setup.generate_auth_token("192.168.1.129")

Be sure to store this auth token somewhere for future use. If you lose this token, you’ll have to generate another. Personally, I just keep it in the scripts I’ve written that call this library.

Examples

Turn on and set to an effect

from nanoleaf import Aurora

my_aurora = Aurora("169.254.123.123", "5EvbR2FjfmYfAkEtOkEnolnZbe6qOB")
my_aurora.on = True
my_aurora.effect = "Violets Are Blue"

Set multiple Auroras to the same random effect

left_side = Aurora("192.168.1.56", "5EvbR2FjfmYfAkEtOkEnolnZbe6qOB")
right_side = Aurora("192.168.1.78", "fAkeR2FjfmYfAkEtOkEnolnZtOkEn")
left_side.effect = right_side.effect_random()

Add a new effect

Presently, you must create your own raw dict that exactly matches the structure found on the API documentation. Methods of making this much easier are planned for future updates.

effect_data = {
    "command": "add",
    "animName": "My Random Animation",
    "animType": "random",
    "colorType": "HSB",
    "animData": None,
    "palette": [
        {
            "hue": 0,
            "saturation": 100,
            "brightness": 100
        },
        {
            "hue": 120,
            "saturation": 100,
            "brightness": 100
        },
        {
            "hue": 240,
            "saturation": 100,
            "brightness": 100
        }
    ],
    "brightnessRange": {
        "minValue": 25,
        "maxValue": 100
    },
    "transTime": {
        "minValue": 25,
        "maxValue": 100
    },
    "delayTime": {
        "minValue": 25,
        "maxValue": 100
    },
    "loop": True
}

my_aurora.effect_add_raw(effect_data)

Delete an effect

my_aurora.effect_delete("My Random Animation")

Metadata

Release files for nanoleaf 0.4.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 nanoleaf 0.4.1
File Size Uploaded Provenance Actions
nanoleaf-0.4.1.tar.gz 32.9 kB Without provenance Details for nanoleaf-0.4.1.tar.gz

Built distribution (wheel)

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

Total release size: 43.3 kB

Release files / nanoleaf-0.4.1.tar.gz

Download URL nanoleaf-0.4.1.tar.gz
Size 32.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1a69f05bf22578196fb068f563048f66b3a1a3db9595678dce9657e956ecb59d
BLAKE2b-256 checksum
How to use checksums
abaaf749e8af9d9b1a9c6844373f27e77e3a4aac29f361f7c6e28c5c04d7ce3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / nanoleaf-0.4.1-py3-none-any.whl

Download URL nanoleaf-0.4.1-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
56c4acfd4ee4c5434abf1c5e4bcc9a0932c2db95984eb6e3c6dea841e65172da
BLAKE2b-256 checksum
How to use checksums
9f2f39e44744ff3a5a26c943a0bf6c857d80a3186572c08c9373b3214c4aefc5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for nanoleaf 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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