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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file govee_lan_control-1.0.3.tar.gz.

File metadata

  • Download URL: govee_lan_control-1.0.3.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.2

File hashes

Hashes for govee_lan_control-1.0.3.tar.gz
Algorithm Hash digest
SHA256 9d020da0f447e1552e42ce3521fde165234918d9135bc979dbd2cbc8e8a1daca
MD5 f91fdbc5dfcf644a116d4dd28cf19ec9
BLAKE2b-256 b016bd73bdd8c1c7fe9240229bd2cf6e184ddd294fd6bfdf575079547760048c

See more details on using hashes here.

File details

Details for the file govee_lan_control-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for govee_lan_control-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d49ee389c3cfa7588b951ae701e495113321f3c4107f22feea90885f31df386c
MD5 1d54211d8408bd834eded4ae0ffe157b
BLAKE2b-256 442db44714949765e77bfcbd123d054d1d0e646178aa1933f3a2a5ba42b87007

See more details on using hashes here.

Supported by

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