Skip to main content

Implementation of the Govee LAN API to control supported Govee products

Project description

Govee LAN API Client

PyPI version Quality Gate Status

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

Usage

pip install govee_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 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


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.2.0.tar.gz (3.3 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_api-0.2.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file govee_lan_api-0.2.0.tar.gz.

File metadata

  • Download URL: govee_lan_api-0.2.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.11.0 Linux/5.15.0-1022-azure

File hashes

Hashes for govee_lan_api-0.2.0.tar.gz
Algorithm Hash digest
SHA256 cff3737c3ea738e25dd6b87a814deea18e4f6062b9b8b69615508986463f365b
MD5 12ded6aea7fd1fb8240bbd4bc7a7a87b
BLAKE2b-256 b2d925966a2e1a30adc0f66075a1fe1eb7ec1396ad3fc774a3fa616d7b97c951

See more details on using hashes here.

File details

Details for the file govee_lan_api-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: govee_lan_api-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.11.0 Linux/5.15.0-1022-azure

File hashes

Hashes for govee_lan_api-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eec8677254cb633e974a8671ea4560ee44150e95c3b2cd6b575b674a42b4f11a
MD5 df8c58d980fdb9dd3e9cd6a6aa496e80
BLAKE2b-256 28da8f96e7c8de825e30a21e621eeed428445df920ec6cc91c047055fbacbdcc

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