Skip to main content

Async API for controlling Hue Lights

Project description

Hue API

Async API for controlling Hue Lights

Python Tests Publish Package Package Version Package Status Python Versions

Installation

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

The minimum Python version required to run this is 3.7

Install the package using pip:

pip install hue-api
hue version

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

Usage

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

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.switch_on()

# or from a sync context
import asyncio
asyncio.run(Bridge.discover())
asyncio.run(light.switch_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.3.0.tar.gz (10.3 kB view hashes)

Uploaded Source

Built Distribution

hue_api-0.3.0-py2.py3-none-any.whl (9.7 kB view hashes)

Uploaded Python 2 Python 3

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