semvec/pypi-packages huggingface dataset:
govee-lan-control 1.0.3
A Python package to control Govee LED devices over the local network using multicast UDP packets.
License: MIT
Requires Python: >=3.6

# 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/* ```