Skip to main content

Async API for controlling Hue Lights

Project description

Hue API

Async API for controlling Hue Lights

Python Tests Publish Package Python Versions Package Version Netlify Status

Documentation: hue-api.nirantak.com

Source: github.com/nirantak/hue-api

Installation

This is an async client to interact with the Hue Bridge API.

The minimum Python version required to run this is 3.8

Install the package using pip:

pip install hue-api

Usage

Follow this link to create a Hue API user if not already known (API reference)

Using the CLI

hue --help

# Get the version of hue-api installed
hue version

# To find your Hue Bridge IP address go to discovery.meethue.com, or run:
hue bridge discover

Using the API

from hue import Bridge, Light

# Create a light object with the light id (number), Bridge IP and user
light = Light(1, ip="your-hue-bridge-ip", user="hue-api-user")

# from an async function
async def main():
  await Bridge.discover()
  await light.power_on()

# or from a sync context
import asyncio
asyncio.run(Bridge.discover())
asyncio.run(light.power_on())

Changelog

See the file CHANGELOG.md

License

This project is licensed under the terms of the MIT license

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

hue-api-0.4.6.tar.gz (35.8 kB view details)

Uploaded Source

Built Distribution

hue_api-0.4.6-py2.py3-none-any.whl (11.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file hue-api-0.4.6.tar.gz.

File metadata

  • Download URL: hue-api-0.4.6.tar.gz
  • Upload date:
  • Size: 35.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.26.0

File hashes

Hashes for hue-api-0.4.6.tar.gz
Algorithm Hash digest
SHA256 b961fd4a205d10678c867ee0a8471c5c29c32840c2c71b9a1da13e0b273061d5
MD5 94c5d278f28e62f0e7c75ed3128c10fb
BLAKE2b-256 fb390693aa84e9b2d1bd3366097285b6d4f0caa0116682ebff5b8c5df608bea9

See more details on using hashes here.

File details

Details for the file hue_api-0.4.6-py2.py3-none-any.whl.

File metadata

  • Download URL: hue_api-0.4.6-py2.py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.26.0

File hashes

Hashes for hue_api-0.4.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a06614dbcc75d9a2eb0e121eca7ac70e4f911550a783adaeb707aa11ee71c775
MD5 1bfa8a51ec1511c27215db3348dd73d8
BLAKE2b-256 e0900cae28b9cc416f26915818d5ec96deab1466fe96b47b675bfd2e2b5bc15e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page