So this is to use the RGB Bulb as a cheap ambilight:
Set the mode as udp (new implementation is what I use)
Set it up as 1 LED (use left or right), port 19446
then set the ip to whatever computer can run this script:.
You'll need to "pip install yeelight"
The script/server:
import socket
import time
from yeelight import *
#UDP SERVER
port = 19446
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.bind(("", port))
print("waiting on port:", port)
#YEELIGHT
bulb = Bulb("BULB_IP_ADDRESS")
bulb.turn_on()
bulb.effect = "sudden"
#Stop/Start music mode, bypasses lamp rate limits, ensures that previous sockets close before starting
bulb.stop_music()
time.sleep(1)
bulb.start_music()
time.sleep(1)
while True:
d = s.recvfrom(3)
bulb.set_rgb(*bytearray(d[0]))