DaanV2 / DaanV2.Hue

A typescript library for controlling Philips Hue lights.

Home Page:https://www.npmjs.com/package/@daanv2/hue

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DaanV2.Hue

🔍 PR npm npm

A typescript library for controlling Philips Hue lights.

Usage

//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.

//Setup bridge connection
const bridge = new Bridge(bridgeId, bridgeIp);
const appKey = bridge.registerDeveloper("<APP ID>#<Device Id>");

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

About

A typescript library for controlling Philips Hue lights.

https://www.npmjs.com/package/@daanv2/hue

License:MIT License


Languages

Language:TypeScript 100.0%