Python API for Govee H6127 RGB lighting strips
Project description
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%
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
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
Built Distribution
Hashes for govee_api_ble-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9bb5d6d11620cc831229c9b5941005a541b81c0f3ffb86b39c10a1f6d428907 |
|
MD5 | 669e0aa1ea5e00e713de01c804169575 |
|
BLAKE2b-256 | a7196b6a99bb8e0e22877ce05aaeddc6f75ca88b615cead91196e66afd20af3e |