Metadata-Version: 2.1
Name: hue-api
Version: 0.4.7
Summary: Async API for controlling Hue Lights
Home-page: https://github.com/nirantak/hue-api
Keywords: hue, lights, async, automation
Author: Nirantak Raghav
Author-email: hey@nirantak.com
Requires-Python: ~=3.8
Description-Content-Type: text/markdown
Classifier: Development Status :: 4 - Beta
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Typing :: Typed
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Requires-Dist: httpx ~=0.22.0
Requires-Dist: typer[all] ~=0.4.0
Requires-Dist: rich ~=11.1.0
Requires-Dist: black ; extra == "dev"
Requires-Dist: coverage ; extra == "dev"
Requires-Dist: flake8 ; extra == "dev"
Requires-Dist: pre-commit ; extra == "dev"
Requires-Dist: tox ; extra == "dev"
Requires-Dist: mkdocs ~=1.2.3 ; extra == "doc"
Requires-Dist: mkdocs-material ~=8.1.9 ; extra == "doc"
Requires-Dist: mkdocstrings ~=0.17.0 ; extra == "doc"
Requires-Dist: pytest ~=6.2.5 ; extra == "test"
Requires-Dist: pytest-asyncio ; extra == "test"
Requires-Dist: pytest-mock ; extra == "test"
Requires-Dist: pytest-cov ; extra == "test"
Requires-Dist: Faker ; extra == "test"
Project-URL: Changelog, https://hue-api.nirantak.com/CHANGELOG/
Project-URL: Documentation, https://hue-api.nirantak.com/
Project-URL: Source, https://github.com/nirantak/hue-api
Provides-Extra: dev
Provides-Extra: doc
Provides-Extra: test

# Hue API

> _Async API for controlling Hue Lights_

[![Python Tests](https://github.com/nirantak/hue-api/actions/workflows/python-test.yml/badge.svg)](https://github.com/nirantak/hue-api/actions/workflows/python-test.yml)
[![Publish Package](https://github.com/nirantak/hue-api/actions/workflows/python-publish.yml/badge.svg)](https://github.com/nirantak/hue-api/actions/workflows/python-publish.yml)
![Python Versions](https://img.shields.io/pypi/pyversions/hue-api)
[![Package Version](https://img.shields.io/pypi/v/hue-api)](https://pypi.org/project/hue-api/)
[![Netlify Status](https://api.netlify.com/api/v1/badges/14cacafe-1ea5-424c-93dd-17d51d9e9804/deploy-status)](https://hue-api.nirantak.com/)

Documentation: [hue-api.nirantak.com](https://hue-api.nirantak.com/)

Source: [github.com/nirantak/hue-api](https://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:

```bash
pip install hue-api
```

## Usage

Follow [this link](https://developers.meethue.com/develop/get-started-2/#so-lets-get-started) to create a Hue API user if not already known ([API reference](https://developers.meethue.com/develop/hue-api/7-configuration-api/#create-user))

### Using the CLI

```bash
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

```python
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](CHANGELOG.md)

## License

This project is licensed under the terms of the [MIT license](https://github.com/nirantak/hue-api/blob/main/LICENSE)

