This code will allow you to use Govee internal UDP api to control your device as well as sync what is on the screen. You need to install the below libs before running:
pip install wmi
pip install pywin32
Update the device IP of the device you want to control on line 21.
If you don't want to get into the different functions and you just want something simple you can run and have work, just run GameSync2023.py file.
To turn the device on/off:
GoveeInternalControl("On")
GoveeInternalControl("Off")
To set the brightness:
GoveeInternalControl("BrightLevel",100) #1-100% expressed as an integer
GoveeInternalControl("BrightLevel",50) #1-100% expressed as an integer
GoveeInternalControl("BrightLevel",10) #1-100% expressed as an integer
To change the color:
GoveeInternalControl("Color",color=(0,255,0)) #Color expressed as a RGB tuple
GoveeInternalControl("Color",color=(255,0,0)) #Color expressed as a RGB tuple
To go into game mode where the screen will sync to the device:
Do note: in this mode the code will attempt to lock onto the window that is in focus.
There is a box size constant you can mess around with if you want to and see if you get better results.
This mode essentially works by creating a square in the center of the app's window. We sample a pixel at each of the four corners of the square, get the color values, then average those 4 color values together. That averaged out value is then sent to the Govee lights over UDP api.
GameTime()
Download UDPReceiver.py and UDPSender.py