A Python package to control Govee LED devices over the local network using multicast UDP packets.
Project description
Govee Lan Control Package
This package implements the Govee LED control sequences listed in - https://app-h5.govee.com/user-manual/wlan-guide. Multicast udp packets are used to identify a Govee LED device on the subnet. UDP control packets are used to control its state, color, brightness, etc.
This package has been developed and tested with only one Govee Device on the network i.e. SKU: H6056, https://us.govee.com/products/govee-rgbicww-wifi-bluetooth-flow-plus-light-bars; having multiple Govee devices on the network could cause issues with this package, and this feature will need to be implemented. (maybe once I buy my 2nd Govee device)
Installation
pip install govee_lan_control
Usage
import time
import random
from govee_lan_control import GoveeLanDevice
# Init the device
led = GoveeLanDevice()
# if device is not found, exit
if led.isInitialized == False:
exit()
# Print the discovered device
print(f"Discovered Govee LED device: {led.name} at IP: {led.ip} with MAC: {led.mac}")
# Turn on the LED
led.on()
# Set the brightness to 50%
led.brightness(50)
time.sleep(1)
# Set the color to white, and the color temperature to 9000K
led.color([255, 255, 255], 9000)
time.sleep(1)
# Set a random color
led.color(
[random.randint(0, 255),
random.randint(0, 255),
random.randint(0, 255)],
9600)
time.sleep(1)
# Blink the LED twice
led.blink(2)
# Turn off the LED
led.off()
Build and Publish
Clean up previous build
$ python3 setup.py clean --all
Build the package
$ python3 setup.py sdist bdist_wheel
Publish the package to pypi.org
$ twine upload dist/*
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for govee_lan_control-1.0.3-py3-none-any.whl
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 | d49ee389c3cfa7588b951ae701e495113321f3c4107f22feea90885f31df386c |
|
| MD5 | 1d54211d8408bd834eded4ae0ffe157b |
|
| BLAKE2b-256 | 442db44714949765e77bfcbd123d054d1d0e646178aa1933f3a2a5ba42b87007 |