Python bindings to control Embrava BlyncLight devices.
Project description
blynclight is a Python package that provides python bindings for the Embrava BlyncLight family of products. These bindings have been tested on MacOS and Linux using an Embrava V30 USB connected light.
Install
pip
$ pip install blynclight
Clone the repo
$ git clone https://github.com/JnyJny/blynclight.git
$ cd blynclight; pip install -e .
Usage
Once installed, the BlyncLight is yours to command!
from blynclight import BlyncLight_API
light = BlyncLight_API.first_light()
red, green, blue = (255, 0, 0), (0, 255, 0), (0, 0, 255)
light.color = green # the light is off and green
light.on = True # the light is on and green
light.flash = True # the light is on, flashing and green
light.color = red # the light is on, flashing and red
light.flash = False # the light is on and red
light.bright = False # the light is on, dim and red
light.color = blue # the light is on, dim and blue
light.bright = True # the light is on and blue
light.on = False # the light is off and blue
More examples can be found in the contrib directory of the git repo.
Build
Embrava distributes a Software Development Kit (SDK) for Windows, MacOS and Linux that developers must first request access to. The MacOS and Linux SDKs provide access to BlyncLight devices via a static library archive. Developers then link their applications against the static library. Unfortunately, Python cannot access static library archives via the the ctypes module. Fortunately, it is relatively easy to unpackage a static library archive into object files and construct a dynamic or shared object. Provided of course that the archived objects are suitable for linking (compiled as position independent code and the right word length as the target python).
Register with Embrava and receive SDK URLs for your operating system.
Clone the repo
$ git clone https://github.com/JnyJny/blynclight.git
Build and install the shared object from the SDK
$ cd blynclight/blynclight_api && make URL=PLATFORM_URL install
Install the package
$ cd .. ; pip install -e .
Uninstall with pip:
$ pip uninstall blynclight
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
Built Distribution
Hashes for blynclight-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3656104bec1cb79cbda55cc8ecce98947869cd12f8ca13274b9eb142ffceed58 |
|
MD5 | 74635bf7260320517127a51dddd2bbfa |
|
BLAKE2b-256 | f15a622bc84c4e6bf202d02d87151d9acd16fd29faec1d8d00054e7eb35a4778 |