Giter VIP home page Giter VIP logo

govee-api-ble's Introduction

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!

govee-api-ble's People

Contributors

softgrass avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.