Govee API
raw JSON → 0.2.2 verified Mon Apr 27 auth: no python
Unofficial Python implementation of the Govee API to control LED strips, bulbs, and other Govee devices. Current version 0.2.2, requires Python >=3.7. The package is maintained on an as-needed basis, with infrequent releases.
pip install govee-api-laggat Common errors
error ImportError: No module named 'govee_api_laggat' ↓
cause Installing `govee-api-laggat` but trying to import with hyphens or wrong underscore pattern.
fix
Use
pip install govee-api-laggat and then from govee_api_laggat import Govee. error requests.exceptions.HTTPError: 400 Client Error: Bad Request ↓
cause Invalid API key or missing required device parameters (device_name, device_mac).
fix
Verify your API key from the Govee app and ensure you pass both
device_name and device_mac from get_devices() to control methods. Warnings
deprecated The method `get_devices()` returns a list of dicts; device parameters like `device_name` and `device_mac` are required in many methods, but the library does not validate them. ↓
fix Always pass both `device_name` and `device_mac` to control methods, as returned by `get_devices()`.
gotcha The library uses an undocumented rate limit; sending commands too quickly may result in silent failures. ↓
fix Add a small delay (e.g., `time.sleep(0.5)`) between commands.
gotcha The `set_color` method expects RGB values as integers (0-255), but does not validate input. Passing floats or out-of-range values causes an unhandled exception. ↓
fix Ensure RGB values are integers and within 0-255 before calling `set_color`.
Imports
- Govee wrong
import govee_controller; from govee.api import Goveecorrectfrom govee_api_laggat import Govee
Quickstart
import os
from govee_api_laggat import Govee
api_key = os.environ.get('GOVEE_API_KEY', '')
govee = Govee(api_key)
devices = govee.get_devices()
if devices:
device = devices[0]
govee.turn_on(device)
govee.set_brightness(device, 50)
govee.set_color(device, 255, 0, 0) # Red