I've written Python language bindings to control BlyncLight devices using Mac OS and Linux. I'm reasonably certain that python on Windows could be made to work and pull requests to fix that would be most welcome.
git clone http://github.com/JnyJny/blynclight.git The package is also available on PyPI and can be installed using:
pip install blynclight Please use the GitHub issue tracker to report bugs or request features.
First, my apologies for not seeing these bug reports. Github is the best way to raise issues with the software since I don't check here very often.
Second, the usb.core.USBError errno13 problem is something I ran into personally when I updated to macOS Mojave (10.14). It seems that Apple clamped down on USB device access thru libusb. I've re-written the python blynclight module (again) to use HIDAPI instead, which is somewhat less convenient than PyUSB but it works on Linux, MacOS and presumably Windows. Installing HIDAPI is relatively straightforward and is detailed at github.com/signal11/hidapi.
Thirdly, while re-writing i found lots of little bugs, like the syntax error in line 189 above, that have been addressed. I've added more testing via pytest to catch more bugs quicker.
Finally, version 0.4.3 is now available vi PyPI or clone it directly from GitHub:
I released version 0.4.6 of my python blynclight module earlier today.
I've learned how to package scripts so they are installed automatically when the package is installed:
- fli : Flash Lights Impressively - rainbow: Smooth color transitions in a rainbow sequence. - throbber : Cyclicly ramps color intensity in a menacing manner. - blync: Provides command-line access to a light's function.
Not sure where to ask for help, so trying here. Sorry to muddy up the thread.
Running the test scripts or my own I cannot get the light to work. I'm on MacOS 10.14 / Python 3.7.3 (brew) with hidapi installed. If I use the Embrava client, the light seems to work fine in manual mode. I have my script outputting the status of what it thinks the light is doing:
Light Status: Device: 0x2c0d:0x000c 0x0000 : red 0x0000 : blue 0x00ff : green 0x0000 : off 0x0000 : dim 0x0000 : flash 0x0000 : speed 0x0000 : music 0x0000 : play 0x0000 : repeat 0x0000 : volume 0x0000 : mute 0x0001 : immediate
I see the values change, but once again the light isn't triggered. Not sure if I'm missing something? Looking for pointers on how to debug. No exceptions thrown.
Control your Embrava BlyncLight from the command-line!
Use the `blync` utility to directly control your Embrava BlyncLight:
```console $ blync -R # turn the light on with red color and leave it on $ blync --off # turn the light off $ blync -RG --dim # turn the light on with yellow color and dim $ blync -RBG # turn the light on with white color ```
Colors can be specified by values between 0 and 255 using the lower-case color options or using the upper-case full value options.
```console $ blync -r 127 # half intensity red $ blync -r 255 # full intensity red $ blync -R # also full intensity red $ blync -r 255 -b 255 -g 255 # full intensity white $ blync -RBG # full intensity white ```
If that's not enough fun, there are three builtin color modes: `fli`, `throbber`, and `rainbow`. All modes continue until the user terminates with a Control-C or platform equivalent.
This module depends on [hidapi](https://github.com/libusb/hidapi), which supports Windows, Linux, FreeBSD and MacOS. Check your favorite package managers before attempting to download and build the library from source.
Options: -l, --light-id INTEGER Light identifier [default: 0] -r, --red INTEGER Red color value range: 0 - 255 [default: 0] -b, --blue INTEGER Blue color value range: 0 - 255 [default: 0] -g, --green INTEGER Green color value range: 0 - 255 [default: 0] -R, --RED Full value red  -B, --BLUE Full value blue  -G, --GREEN Full value green  -o, --off / -n, --on Turn the light off/on. [default: False] -d, --dim Toggle bright/dim mode. [default: False] -f, --flash Enable flash mode. -p, --play INTEGER Select song: 1-15 --repeat Repeat the selected song. [default: False] --volume INTEGER Set the volume: 1-10 [default: 5] -a, --list-available -v, --verbose -V, --version --install-completion Install completion for the current shell. --show-completion Show completion for the current shell, to copy it or customize the installation.
The latest version, 0.11.0, of the python BlyncLight bindings greatly simplified installation. The user no longer needs to install HIDAPI before being able to use this package. Just install it with pip and enjoy.