Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/daanv2/daanv2.hue

A typescript library for controlling Philips Hue lights.
https://github.com/daanv2/daanv2.hue

api hue hue-bridge hue-light hue-lights library typescript typescript-library

Last synced: 1 day ago
JSON representation

A typescript library for controlling Philips Hue lights.

Awesome Lists containing this project

README

        

# DaanV2.Hue

[![🔍 PR](https://github.com/DaanV2/DaanV2.Hue/actions/workflows/pull-request.yml/badge.svg)](https://github.com/DaanV2/DaanV2.Hue/actions/workflows/pull-request.yml)
![npm](https://img.shields.io/npm/v/%40daanv2%2Fhue)
![npm](https://img.shields.io/npm/dw/%40daanv2%2Fhue)

A typescript library for controlling Philips Hue lights.

## Usage

```typescript
//Get bridges on network
const bridges = await Discovery.getBridgesOnNetwork();

//Setup bridge connection
const bridge = new Bridge(bridgeId, bridgeIp);
const app = await ApplicationConnection.setupApplication(bridge, appKey);
```

## First time setup between bridge and application

The bridge needs to authorize the application before it can be used. This is done by pressing the button on the bridge and then calling the following function.

```typescript
//Setup bridge connection
const bridge = new Bridge(bridgeId, bridgeIp);
const appKey = bridge.registerDeveloper("#");

//Then setup the application connection
const app = await ApplicationConnection.setupApplication(bridge, appKey);
```