blinkstick-python
blinkstick-python copied to clipboard
turn_off() does not work for BlinkStick Strip
The below code sets all the LEDs on the Blinkstick Strip to blue but does not turn them off.
from blinkstick import blinkstick
bstick = blinkstick.find_first()
for i in range(8):
bstick.set_color(index=i, name="blue")
bstick.turn_off()
My current workaround is to set them all to "black"
.
Have you tried just "off" instead? e.g. self.off() (or bstick.off() in your case). That's what I use.
For the record:
bstick.turn_off()
(only) works for the first LED
One way to do it instantly is with bstick.set_led_data(0, [0]*3*led_nbr)
The off
method is defined in the class BlinkStickPro
but blinkstick.find_first()
returns an instance of the BlinkStick
class.