govee-api-ble
A Python API for Govee H6127 RGB lighting strips
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!
Metadata
Release files for govee-api-ble 0.0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| govee-api-ble-0.0.9.tar.gz | 5.2 kB | Without provenance | Details for govee-api-ble-0.0.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| govee_api_ble-0.0.9-py3-none-any.whl | Python 3 | none | any | Details for govee_api_ble-0.0.9-py3-none-any.whl |
Total release size: 10.6 kB
Release files / govee-api-ble-0.0.9.tar.gz
| Download URL | govee-api-ble-0.0.9.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7fda15011db46bb3fab241c0295300b637a1631b00e4340da33cc124cc3bfb29
|
|
BLAKE2b-256 checksum How to use checksums |
d595a3bd06e101e4db9f386c4defc94b280d250c983937cd729b3d2d3e292acf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.6
|
Release files / govee_api_ble-0.0.9-py3-none-any.whl
| Download URL | govee_api_ble-0.0.9-py3-none-any.whl |
|---|---|
| Size | 5.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fde63eba283b3424da125b2b71fdb645f8e7610f9da0bf3cb3e0e3c2ac8dca7f
|
|
BLAKE2b-256 checksum How to use checksums |
e7af9f5e6c82aef067750a2b2da52c138fcc444031a4d3a984b83130c412047d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.6
|
Security for govee-api-ble 0.0.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.