Music mode commands only work intermittently
Hi,
I'm using your library to try to get my bulbs to change color rapidly. I tried to use following snippet, but only some of the commands make it to the bulb. When I use the same commands without music mode it works flawlessly, until I get rate limited. Is there something I'm doing wrong? Happy to work with you to debug.
from yeelight import Bulb
import time
#connect to bulb
yee_bulb = Bulb("BULB_IP", effect="sudden")
yee_bulb.turn_off()
print(yee_bulb.get_properties())
#turn on bulb
yee_bulb.turn_on()
#set initial color
yee_bulb.set_rgb(blue=255, red=0, green=0)
#MUSIC MODE TEST
yee_bulb.start_music()
for z in range(0, 10):
yee_bulb.set_rgb(blue=0, red=0, green=255)
time.sleep(.05)
yee_bulb.set_rgb(blue=255, red=0, green=0)
time.sleep(.05)
yee_bulb.send_command("set_music", [0])
yee_bulb.turn_off()
time.sleep(1)
#SAME TEST WITHOUT MUSIC MODE
yee_bulb = Bulb("BULB_IP", effect="sudden")
print(yee_bulb.get_properties())
yee_bulb.turn_on()
yee_bulb.set_brightness(brightness=100)
for z in range(0, 10):
yee_bulb.set_rgb(blue=0, red=0, green=255)
time.sleep(.05)
yee_bulb.set_rgb(blue=255, red=0, green=0)
time.sleep(.05)
print(yee_bulb.get_properties())