Implementation of the Govee LAN API to control supported Govee products
Project description
Govee LAN API Client
A simple API client for Govee's LAN UDP API
This was done in a weekend to help support a home assistant plugin for controlling govee devices over their new(ish) LAN API
Here's some sample code that I'm using to test this -- formal API docs and tests coming soon.
from govee-lan-api.client import GoveeClient
import asyncio
import logging
LIVING_ROOM_LIGHT = '18:66:C4:32:38:30:1E:32'
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
PURPLE = (248, 207, 255)
async def main():
logging.basicConfig(level=logging.DEBUG)
client = GoveeClient()
await client.turn_on(LIVING_ROOM_LIGHT)
await client.set_brightness(LIVING_ROOM_LIGHT, 100)
await client.set_color_by_rgb(LIVING_ROOM_LIGHT, GREEN)
await client.set_brightness(LIVING_ROOM_LIGHT, 50)
await client.set_brightness(LIVING_ROOM_LIGHT, 1)
await client.set_brightness(LIVING_ROOM_LIGHT, 100)
await client.turn_on(LIVING_ROOM_LIGHT)
await client.set_color_by_rgb(LIVING_ROOM_LIGHT, RED)
await client.set_color_by_rgb(LIVING_ROOM_LIGHT, GREEN)
await client.set_color_by_rgb(LIVING_ROOM_LIGHT, BLUE)
await client.set_color_by_rgb(LIVING_ROOM_LIGHT, PURPLE)
if __name__ == "__main__":
asyncio.run(main())
Project details
Release history Release notifications | RSS feed
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_api-0.1.1.tar.gz
(3.3 kB
view hashes)
Built Distribution
Close
Hashes for govee_lan_api-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 071d5c2060dd16ba80ea7de700e8df15f2a6fa346d2e077fb044acf5c5610374 |
|
MD5 | d9a4073c0437f70c8ad4ee8f8cd1afd9 |
|
BLAKE2b-256 | c5376df205c0784baed0b2a0bec410b1661b5fb7165a56fb7560db535ec8ffbd |