Name | govee-py2 JSON |
Version |
0.0.6
JSON |
| download |
home_page | |
Summary | Interacting with Govee Lights via Python |
upload_time | 2023-12-10 06:46:16 |
maintainer | |
docs_url | None |
author | Sxzo |
requires_python | |
license | |
keywords |
python
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Govee API 2.0 Python Library (2023)
This is a super simple interface for interacting with Govee smart lights via Python.
There are three primary functions to control the lights:
- Toggle power
- Set brightness
- Set color
## Initializing a Client
To interact with Govee devices on your network, you'll need a Govee API key. You can request one from in-app or browser on the Govee platform.
```
from govee import GoveeClient
client = GoveeClient("API KEY")
```
A client is initialized with 3 key values:
```
from govee import GoveeClient
client = GoveeClient("API KEY")
# Access the client device list:
client.devices
# Access the client network SSID
client.ssid
# Access the client API key
client.key
```
All device interaction revolves around actual device objects. All available devices at the time of client initialization are stored in `GoveeClient.devices`
## Toggle Power
`@param mode = "on", "off", or None`
```
from govee import GoveeClient
client = GoveeClient("API KEY")
# Get the first device object
wall_lights = client.devices[0]
# Toggle Power (if on -> off | if off -> on)
wall_lights.toggle()
# Turn on
wall_lights.toggle(mode="on")
# Turn off
wall_lights.toggle(mode="off")
```
## Set Brightness
`@param int brightness = 0-100`
Note that setting the brightness to 0 will power off the device.
```
from govee import GoveeClient
client = GoveeClient("API KEY")
# Get the first device object
wall_lights = client.devices[0]
# Set the brightness to 50%
wall_lights.set_brightness(50)
```
## Set Color
`@param tuple colors = ((0-255), (0-255), (0-255))`
@colors is in the format: (R, G, B)
```
from govee import GoveeClient
client = GoveeClient("API KEY")
# Get the first device object
wall_lights = client.devices[0]
# Set the lights red
wall_lights.set_color(255, 0, 0)
# Set the lights green
wall_lights.set_color(0, 255, 0)
# Set the lights blue
wall_lights.set_color(0, 0, 255)
```
<sub> *This functionality is dependent upon Govee's API which is not my creation. All rights and credit reserved to Govee 2023 ©.* </sub>
Raw data
{
"_id": null,
"home_page": "",
"name": "govee-py2",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "python",
"author": "Sxzo",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/b0/f3/075d22392761442555dabeb0f9cd41138a578c6f27f8d6bc1d7e13c61b76/govee-py2-0.0.6.tar.gz",
"platform": null,
"description": "\r\n# Govee API 2.0 Python Library (2023)\r\n\r\nThis is a super simple interface for interacting with Govee smart lights via Python. \r\n\r\n\r\n\r\nThere are three primary functions to control the lights:\r\n\r\n- Toggle power\r\n\r\n- Set brightness\r\n\r\n- Set color\r\n\r\n\r\n\r\n## Initializing a Client\r\n\r\nTo interact with Govee devices on your network, you'll need a Govee API key. You can request one from in-app or browser on the Govee platform. \r\n\r\n```\r\n\r\nfrom govee import GoveeClient\r\n\r\n\r\n\r\nclient = GoveeClient(\"API KEY\")\r\n\r\n```\r\n\r\nA client is initialized with 3 key values:\r\n\r\n```\r\n\r\nfrom govee import GoveeClient\r\n\r\n\r\n\r\nclient = GoveeClient(\"API KEY\")\r\n\r\n\r\n\r\n# Access the client device list:\r\n\r\nclient.devices\r\n\r\n\r\n\r\n# Access the client network SSID\r\n\r\nclient.ssid\r\n\r\n\r\n\r\n# Access the client API key\r\n\r\nclient.key\r\n\r\n```\r\n\r\n\r\n\r\nAll device interaction revolves around actual device objects. All available devices at the time of client initialization are stored in `GoveeClient.devices`\r\n\r\n\r\n\r\n## Toggle Power\r\n\r\n`@param mode = \"on\", \"off\", or None`\r\n\r\n\r\n\r\n```\r\n\r\nfrom govee import GoveeClient\r\n\r\n\r\n\r\nclient = GoveeClient(\"API KEY\")\r\n\r\n\r\n\r\n# Get the first device object\r\n\r\nwall_lights = client.devices[0]\r\n\r\n\r\n\r\n# Toggle Power (if on -> off | if off -> on)\r\n\r\nwall_lights.toggle()\r\n\r\n\r\n\r\n# Turn on \r\n\r\nwall_lights.toggle(mode=\"on\")\r\n\r\n\r\n\r\n# Turn off\r\n\r\nwall_lights.toggle(mode=\"off\")\r\n\r\n\r\n\r\n```\r\n\r\n\r\n\r\n## Set Brightness\r\n\r\n`@param int brightness = 0-100`\r\n\r\n\r\n\r\nNote that setting the brightness to 0 will power off the device. \r\n\r\n```\r\n\r\nfrom govee import GoveeClient\r\n\r\n\r\n\r\nclient = GoveeClient(\"API KEY\")\r\n\r\n\r\n\r\n# Get the first device object\r\n\r\nwall_lights = client.devices[0]\r\n\r\n\r\n\r\n# Set the brightness to 50%\r\n\r\nwall_lights.set_brightness(50)\r\n\r\n\r\n\r\n```\r\n\r\n\r\n\r\n## Set Color\r\n\r\n`@param tuple colors = ((0-255), (0-255), (0-255))`\r\n\r\n\r\n\r\n@colors is in the format: (R, G, B)\r\n\r\n```\r\n\r\nfrom govee import GoveeClient\r\n\r\n\r\n\r\nclient = GoveeClient(\"API KEY\")\r\n\r\n\r\n\r\n# Get the first device object\r\n\r\nwall_lights = client.devices[0]\r\n\r\n\r\n\r\n# Set the lights red\r\n\r\nwall_lights.set_color(255, 0, 0)\r\n\r\n\r\n\r\n# Set the lights green\r\n\r\nwall_lights.set_color(0, 255, 0)\r\n\r\n\r\n\r\n# Set the lights blue\r\n\r\nwall_lights.set_color(0, 0, 255)\r\n\r\n\r\n\r\n```\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<sub> *This functionality is dependent upon Govee's API which is not my creation. All rights and credit reserved to Govee 2023 \u00a9.* </sub>\r\n\r\n",
"bugtrack_url": null,
"license": "",
"summary": "Interacting with Govee Lights via Python",
"version": "0.0.6",
"project_urls": null,
"split_keywords": [
"python"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a705d78fd7a12e7a32b529603db0bd0351a930cfa8010471c9717a03241b8f2b",
"md5": "4fb2d9781818a1b78a460bd4c706e9ce",
"sha256": "a6ba6252acfcdf3defca63573e72a96d6fb05ecc0f610ebd1333e79aff90ac6a"
},
"downloads": -1,
"filename": "govee_py2-0.0.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4fb2d9781818a1b78a460bd4c706e9ce",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 3848,
"upload_time": "2023-12-10T06:46:14",
"upload_time_iso_8601": "2023-12-10T06:46:14.838276Z",
"url": "https://files.pythonhosted.org/packages/a7/05/d78fd7a12e7a32b529603db0bd0351a930cfa8010471c9717a03241b8f2b/govee_py2-0.0.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b0f3075d22392761442555dabeb0f9cd41138a578c6f27f8d6bc1d7e13c61b76",
"md5": "251e024a28db7846d96bb389b5f3d3a3",
"sha256": "c824b0c74df99db14ccb7a0b39e6e2da8e38e89036caf4c05c9561a51130d369"
},
"downloads": -1,
"filename": "govee-py2-0.0.6.tar.gz",
"has_sig": false,
"md5_digest": "251e024a28db7846d96bb389b5f3d3a3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3897,
"upload_time": "2023-12-10T06:46:16",
"upload_time_iso_8601": "2023-12-10T06:46:16.196885Z",
"url": "https://files.pythonhosted.org/packages/b0/f3/075d22392761442555dabeb0f9cd41138a578c6f27f8d6bc1d7e13c61b76/govee-py2-0.0.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-10 06:46:16",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "govee-py2"
}