Skip to main content

Python API for Govee H6127 RGB lighting strips

Project description

govee-api-ble

A Python API for Govee H6127 RGB lighting strips

Python PIP Package Site!

This project is still in progress! If you have any issue, post an issue. If you have a fix, make a pull request

This project currently uses os.system and will only work on UNIX systems! I'm working on a fix for this, but in the meantime, this is what """works"""!

Huge thanks to BeauJBurroughs for their amazing research! Without them this would not be possible :-)

Requirements and Setup

For this package you will need

  • A UNIX Device (Preferably a Raspberry Pi)
  • Python 3.6<=
  • BlueZ with gattool To install, simply type
pip install govee-api-ble

Initialization

You will first need the MAC address for your light strip

This can easily be found by doing hcitool scan on a Raspberry Pi or by looking in your settings on the Govee app

To other devices, the strip will most likely be named ihoment-h6127 since that is the manufacturer's old name.

To initialize an object, add to your code:

from govee_api_ble import GoveeDevice

my_device = GoveeDevice(FA:KE:MA:CH:ER:E0)

Replacing the argument with your device's MAC address

Usage

Power On/Off Example

my_device.setPower(status)

Accepts boolean value to turn device on/off

from govee_api_ble import GoveeDevice
# Initialize the device
my_device = GoveeDevice(FA:KE:MA:CH:ER:E0)

my_device.setPower(True) # Turns device on
my_device.setPower(False) # Turns device off

Set Device Color Example

my_device.setColor([r,g,b])

Accepts three RGB values as a list

from govee_api_ble import GoveeDevice
# Initialize the device
my_device = GoveeDevice(FA:KE:MA:CH:ER:E0)

my_device.setColor([0,0,255]) # Sets entire light strip to blue

Set Device Brightness Example

my_device.setBrightness(level)

Accepts int between 0-100 and sets device brightness to number

from govee_api_ble import GoveeDevice
# Initialize the device
my_device = GoveeDevice(FA:KE:MA:CH:ER:E0)

my_device.setBrightness(50) # Sets brightness to 50%

Set Device Scene Example

my_device.setScene(setting)

Accepts string, uses name of any scene setting that can be found in the Govee app

from govee_api_ble import GoveeDevice
# Initalize the device
my_device = GoveeDevice(FA:KE:MA:CH:ER:E0)

my_device.setScene("blinking") # Sets scene to blinking mode

Set Music Mode Example

my_device.setColorMusic(setting,[r,g,b])

Accepts string using name of the music mode, which can be found in the Govee app

Also accepts three RGB values as a list for the spectrum mode

At the moment, rolling mode does not work

from govee_api_ble import GoveeDevice
# Initalize the device
my_device = GoveeDevice(FA:KE:MA:CH:ER:E0)

my_device.setColorMusic("rhythm") # Sets music mode to rhythm
my_device.setColorMusic("spectrum",[0,0,255]) # Sets music mode to spectrum with the color blue

Help with Development!

  • Run pip install setuptools wheel
  • Fork and clone the repository
  • Create a branch with a descriptive name
  • Run tests & debug before pulling
  • Commit and start a pull request!

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-api-ble-0.0.9.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

govee_api_ble-0.0.9-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file govee-api-ble-0.0.9.tar.gz.

File metadata

  • Download URL: govee-api-ble-0.0.9.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.6

File hashes

Hashes for govee-api-ble-0.0.9.tar.gz
Algorithm Hash digest
SHA256 7fda15011db46bb3fab241c0295300b637a1631b00e4340da33cc124cc3bfb29
MD5 ae7db987f6011e45ded3fdcee9213b1c
BLAKE2b-256 d595a3bd06e101e4db9f386c4defc94b280d250c983937cd729b3d2d3e292acf

See more details on using hashes here.

File details

Details for the file govee_api_ble-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: govee_api_ble-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.6

File hashes

Hashes for govee_api_ble-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 fde63eba283b3424da125b2b71fdb645f8e7610f9da0bf3cb3e0e3c2ac8dca7f
MD5 2ac510e5d783fcda154a4c834fb01303
BLAKE2b-256 e7af9f5e6c82aef067750a2b2da52c138fcc444031a4d3a984b83130c412047d

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