cnlohr / colorchord

Chromatic Sound to Light Conversion System
Other
678 stars 116 forks source link

how to write a new display output driver? #112

Open Dahrkael opened 4 years ago

Dahrkael commented 4 years ago

I have some Yeelight bulbs in my living room and I would like to output to them, but I don't see any documentation on how to write a new display (or how the existing ones work exactly). Yeelight music mode works by telling the bulb to connect to a TCP server, which then will send json commands at whatever rate. My theory is that I can manage the bulbs with any of the available external programs and point them to connect to colorchord (assuming I can run a TCP server inside somewhere), then just spit some hardcoded json sprintf'd with the required brightness and color values.

does that make sense? is it possible? any hints? thanks

cnlohr commented 4 years ago

You could copy-and-paste DisplayNetwork, and modify it to your needs. It has an example UDP client, and making a TCP server wouldn't be bad. As long as the JSON is cleanly formatted it should be pretty easy to generate with some sprintfs.