Apache License 2.0

项目介绍

openhue/openhue-api 是一个托管在 GitHub 上的开源项目,主要使用 Makefile 编写,采用 Apache License 2.0 许可证,目前获得 212 个 Star、24 次 Fork。

仓库全名
openhue/openhue-api
开源许可证
Apache License 2.0
Star 数
212
Fork 数
24
未关闭 Issue
1

README 摘要

OpenHue API OpenHue is an open-source project that provides a comprehensive OpenAPI specification for the Philips Hue REST API, known as CLIP (Connected Lighting Interface Protocol) API. This specification serves as a bridge between developers and Philips Hue smart lighting systems, enabling seamless integration and control of Hue lighting within various applications and platforms. 📣 Follow the project roadmap and…

完整内容见 GitHub 原始 README 或本页 。

常见问题

openhue-api 用什么语言开发?

主要使用 Makefile 编写,采用 Apache License 2.0 许可证,目前有 212 个 Star。

openhue-api 可以免费商用吗?

仓库采用 Apache License 2.0 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 openhue-api 的源码?

可以直接克隆仓库:git clone https://github.com/openhue/openhue-api.git,默认分支为 main;安装与运行步骤见仓库 README。

openhue-api 最近还在维护吗?

仓库最近一次更新为 4月15日,当前有 1 个未关闭 Issue;Star 数为 212,可作为社区活跃度的参考。

关于

OpenHue API is an open-source project that provides a comprehensive OpenAPI specification for the Philips Hue REST API

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

简要分析

热度分
262
价值分
134
活跃状态
活跃

语言占比

Makefile

Release

README

OpenHue API

Build GitHub Releases API Docs

OpenHue is an open-source project that provides a comprehensive OpenAPI specification for the Philips Hue REST API, known as CLIP (Connected Lighting Interface Protocol) API. This specification serves as a bridge between developers and Philips Hue smart lighting systems, enabling seamless integration and control of Hue lighting within various applications and platforms.

OpenHue Logo

📣 Follow the project roadmap and join the discussion in our GitHub Discussions!

Table of Contents

Introduction

The Philips Hue lighting system is renowned for its versatility and convenience in home and commercial lighting solutions. However, developers often face challenges when attempting to interact with Hue devices programmatically due to the complexity of the underlying REST API. OpenHue aims to simplify this process by offering a well-structured and fully-documented OpenAPI specification.

With OpenHue, developers can:

  • Effortlessly Integrate Philips Hue: OpenHue provides a clear and standardized way to connect your applications and services with Philips Hue smart lighting, allowing for easy automation, customization, and remote control of lighting scenes and individual bulbs.
  • Enhance User Experiences: By integrating OpenHue into your projects, you can create innovative lighting experiences that respond to user interactions, environmental conditions, or specific events, enhancing user comfort and ambiance.
  • Save Development Time: Avoid the complexities of reverse-engineering the Philips Hue API. OpenHue eliminates the need for developers to decipher the API’s intricacies and reduces development time, enabling faster implementation of Hue-related features.

Supported Resources

The OpenHue specification covers the following Hue API resources:

  • Lighting: light, grouped_light
  • Rooms & Zones: room, zone, bridge_home
  • Scenes: scene, smart_scene
  • Sensors: motion, temperature, light_level, button, bell_button, relative_rotary, contact, tamper, camera_motion
  • Grouped Sensors: grouped_motion, grouped_light_level
  • Motion Areas: convenience_area_motion, security_area_motion, motion_area_candidate, motion_area_configuration
  • Devices: device, device_power, device_software_update, bridge, service_group
  • Connectivity: zigbee_connectivity, zgp_connectivity, wifi_connectivity, zigbee_device_discovery
  • Entertainment: entertainment, entertainment_configuration, speaker
  • Automation: behavior_script, behavior_instance, geofence_client, geolocation
  • Smart Home: homekit, matter, matter_fabric

Quick Start

# Get the OpenAPI spec
curl -O https://api.redocly.com/registry/bundle/openhue/openhue/v2/openapi.yaml

# Or generate a client (e.g., Python)
npx @openapitools/openapi-generator-cli generate -g python -i https://api.redocly.com/registry/bundle/openhue/openhue/v2/openapi.yaml -o my-openhue-client

Usage

Introduction video on YouTube

To use the OpenHue OpenAPI specification in your projects, you can obtain it from our GitHub releases. Here’s how:

Obtain the OpenAPI Specification

The OpenHue OpenAPI Specification is hosted on Redocly, you can directly obtain it via this link.

Click here to view the specification via the Swagger Editor.

From GitHub
  1. Visit our GitHub releases page.
  2. Select the desired release version that suits your needs. Each release contains the complete OpenAPI specification for OpenHue.
  3. Download the openhue.yaml file from the selected release. This YAML file represents the OpenAPI specification, which defines the structure and behavior of the OpenHue API.

Integration with Postman

You can easily import the OpenAPI specification into Postman, a popular API development and testing tool. Here’s how:

  1. Open Postman and click on the “Import” button in the top-left corner of the application.
  2. Select “API schema” as the import type.
  3. Upload the openhue.yaml file that you downloaded from the OpenHue release.
  4. Postman will automatically generate a collection based on the OpenAPI specification, allowing you to make requests to the OpenHue API with ease.

Generate Client Code

The OpenAPI specification openhue.yaml can be used to generate client code in virtually any programming language. There are various tools and libraries available that can take the specification, and generate client code tailored to your language of choice.

Here’s a basic example using the openapi-generator-cli to generate a Python client:

npx @openapitools/openapi-generator-cli generate -g python -i https://api.redocly.com/registry/bundle/openhue/openhue/v2/openapi.yaml -o my-openhue-project

ℹ️ openapi-generator-cli requires Java 17 to be installed

Getting Started

To begin developing with OpenHue’s OpenAPI specification, follow these steps:

Prerequisites

Before you start, ensure that you have the following prerequisites installed:

  • Git: For cloning and version control.
  • Node.js and NPM: OpenHue relies on Node.js and NPM for certain tasks. Make sure you have them installed. You can download them from the official website: Node.js.
  • Make: For running build commands (pre-installed on macOS/Linux).

Fork the Repository

Before contributing to OpenHue, it’s a good practice to fork the repository to your own GitHub account. This will create a copy of the project that you can work on independently. See CONTRIBUTING.md for detailed contribution guidelines.

Setup

  1. Clone the OpenHue repository to your local machine:
git clone https://github.com/your-username/openhue-api.git
cd openhue-api
  1. Run the following command to set up the development environment. This will install the Redocly CLI, which is used for documentation management:
make setup

Validate the Specification

Before proceeding, it’s essential to ensure that the OpenAPI specification is valid and error-free. You can do this by running the following command:

make verify

This command will validate the specification file and provide feedback if there are any issues.

Build the Specification

To bundle the OpenAPI specification into a single file, run the following command:

make build

The bundled specification file can be found at build/openhue.yaml. This consolidated file makes it easier to work with the API definition and can be used for various purposes, including generating client libraries and documentation.

Build the Documentation

To build the static HTML documentation, run the following command:

make docs

The bundled documentation can be found at build/index.html. The build/ folder will also contain all the files required to display the HTML page, including images, fonts, etc.

With these initial setup steps completed, you’re ready to start developing and utilizing the OpenHue OpenAPI specification for your projects.

License

GitHub License file

OpenHue is distributed under the Apache License 2.0, making it open and free for anyone to use and contribute to. See the license file for detailed terms.

Acknowledgments

We want to extend our heartfelt gratitude to GitBook for their generous support of the OpenHue Project. GitBook’s commitment to helping open-source initiatives like ours thrive is truly appreciated. They have graciously provided the OSS plan for OpenHue, which will be instrumental in our documentation efforts, making it easier for developers and users to get started with OpenHue.

评论

暂无评论