Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/daanv2/daanv2.hue
- Owner: DaanV2
- License: mit
- Created: 2023-03-26T19:48:45.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-02T07:59:33.000Z (2 months ago)
- Last Synced: 2024-12-27T18:46:49.199Z (14 days ago)
- Topics: api, hue, hue-bridge, hue-light, hue-lights, library, typescript, typescript-library
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@daanv2/hue
- Size: 427 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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);
```