Metadata-Version: 2.4 Name: aionanoleaf2 Version: 1.0.2 Summary: Async Python package for the Nanoleaf API that replaces aioNanoleaf. Home-page: https://github.com/loebi-ch/aionanoleaf2 Author: loebi-ch Author-email: andy@slyweb.ch License: LGPLv3+ Project-URL: Bug Tracker, https://github.com/loebi-ch/aionanoleaf2/issues Project-URL: Source Code, https://github.com/loebi-ch/aionanoleaf2 Project-URL: Documentation, https://github.com/loebi-ch/aionanoleaf/blob/master/README.md Keywords: nanoleaf api canvas shapes elements light panels strips essentials 4d emersion Classifier: Programming Language :: Python :: 3 Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+) Classifier: Operating System :: OS Independent Classifier: Development Status :: 4 - Beta Classifier: Intended Audience :: Developers Classifier: Natural Language :: English Classifier: Topic :: Home Automation Classifier: Typing :: Typed Requires-Python: >=3.8 Description-Content-Type: text/markdown License-File: LICENSE Requires-Dist: aiohttp Dynamic: author Dynamic: author-email Dynamic: classifier Dynamic: description Dynamic: description-content-type Dynamic: home-page Dynamic: keywords Dynamic: license Dynamic: license-file Dynamic: project-url Dynamic: requires-dist Dynamic: requires-python Dynamic: summary # aioNanoleaf2 package [![PyPI](https://img.shields.io/pypi/v/aionanoleaf2)](https://pypi.org/project/aionanoleaf2/) ![PyPI - Downloads](https://img.shields.io/pypi/dm/aionanoleaf2) [![PyPI - License](https://img.shields.io/pypi/l/aionanoleaf2?color=blue)](https://github.com/loebi-ch/aionanoleaf2/blob/master/LICENSE) This async Python wrapper for the Nanoleaf API replaces the no longer maintained aioNanoleaf package. The original aioNanoleaf has been modified to: - add support for Nanoleaf Essentials devices. - add support for Screen Mirroring emersion modes (1D, 2D, 3D, 4D). - add support for IPv6 hosts. ## Installation ```bash pip install aionanoleaf2 ``` ## Example ```python from aiohttp import ClientSession from asyncio import run import aionanoleaf2 async def test(): async with ClientSession() as session: nanoleaf = aionanoleaf2.Nanoleaf(session, "192.168.1.28") try: await nanoleaf.authorize() except aionanoleaf2.Unauthorized as ex: print("Not authorized:", ex) return await nanoleaf.turn_on() await nanoleaf.get_info() print("IT'S WORKING!"); print("Host:", nanoleaf.host) print("Port:", nanoleaf.port) print("API URL:", nanoleaf._api_url) print("Name:", nanoleaf.name) print("Manufacturer:", nanoleaf.manufacturer) print("Model:", nanoleaf.model) print("Serial number:", nanoleaf.serial_no) print("Hardware version:", nanoleaf.hardware_version) print("Firmware version:", nanoleaf.firmware_version) print("On:", nanoleaf.is_on); print("Brightness:", f"{nanoleaf.brightness} [{nanoleaf.brightness_min} - {nanoleaf.brightness_max}]") print("Hue:", f"{nanoleaf.hue} [{nanoleaf.hue_min} - {nanoleaf.hue_max}]") print("Saturation:", f"{nanoleaf.saturation} [{nanoleaf.saturation_min} - {nanoleaf.saturation_max}]") print("Color temperature:", f"{nanoleaf.color_temperature} [{nanoleaf.color_temperature_min} - {nanoleaf.color_temperature_max}]") print("Color mode:", nanoleaf.color_mode) print("Effects:", nanoleaf.effects_list) print("Selected effect:", nanoleaf.selected_effect) print("Emersions:", nanoleaf.emersion_list) print("Selected emersion:", nanoleaf.selected_emersion) print("Panels:", len(nanoleaf.panels)) await nanoleaf.identify() await nanoleaf.turn_off() await nanoleaf.deauthorize() run(test()) ```