Skip to main content

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

govee_lan_control-1.0.3.tar.gz (4.8 kB view hashes)

Uploaded Source

Built Distribution

govee_lan_control-1.0.3-py3-none-any.whl (5.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page