|
Post by jnyjny on Jan 14, 2018 6:12:56 GMT
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.
|
|
|
Post by mirriam on Feb 8, 2018 2:41:53 GMT
Exactly what I was after.
Thanks jnyjny
|
|
|
Post by jnyjny on Aug 25, 2018 15:57:32 GMT
|
|
|
Post by jnyjny on Aug 31, 2018 12:00:25 GMT
I've released a new version of the python blynclight module, 0.2.0. Source is available on GitHub.com/JnyJny/blyncligt.git and installable via pip.
This new version uses the open source Signal 11 HID API to send commands to the light. Tip of the hat to Offbeatmammal for his node.js bindings from which I unabashedly cribbed.
|
|
|
Post by that guy on Nov 9, 2018 23:53:37 GMT
jnyjny - I don't see your changes with hidapi. The blynclight.py still shows usb.core being used.
|
|
|
Post by fbellom on Nov 22, 2018 23:27:06 GMT
I'm hitting this error when run this in MacOS usb.core.USBError: [Errno 13] Access denied (insufficient permissions)
And when try it on Debian (RaspberryPI Strecth) I got an error on the line 189 of blynclight.py regarding a Sytax error
What do I miss here?
|
|
|
Post by jnyjny on Apr 4, 2019 11:33:54 GMT
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: $ pip3 install -U blynclight $ git clone github.com/jnyjny/blynclight.gitThere are a number of scripts in the contrib directory which demonstrate how the module can be used: contrib/fli.py : flash light impressively contrib/rainbow.py : smoothly transitions colors in a rainbow sequence contrib/throbber.py : cycles color intensity Again, for more timely responses to issues or enhancement requests, please use GitHub's issue tracker. Have fun!
|
|
|
Post by jnyjny on Apr 25, 2019 23:45:32 GMT
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. Raise issues on GitHub @ github.com/JnyJny/blynclight.git
|
|
dusty
New Member
Posts: 2
|
Post by dusty on Jun 10, 2019 17:08:11 GMT
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. UPDATE: I have opened an issue on Git Hub, as I should have initially.
|
|
|
Post by jnyjny on Jun 21, 2019 15:53:21 GMT
|
|
|
Post by jnyjny on Jun 21, 2020 0:56:59 GMT
I've updated my blynclight python package: 0.7.1 and should support Windows, Mac, and Linux. github.com/JnyJny/blynclight.git for more information. If you already have the package installed: $ python3 -m pip install -U blynclight $ blync --help Usage: blync [OPTIONS] COMMAND [ARGS]...
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.
```console $ blync fli $ blync throbber $ blync rainbow ```
Installation
```console $ python3 -m pip install blynclight $ python3 -m pip install git+https://github.com/JnyJny/blynclight.git # latest ```
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 [255] -B, --BLUE Full value blue [255] -G, --GREEN Full value green [255] -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.
--help Show this message and exit.
Commands: fli Flash Light Impressively. rainbow BlyncLights Love Rainbows. throbber BlyncLight Intensifies.
|
|
|
Post by jnyjny on Jul 11, 2020 22:52:55 GMT
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.
|
|