Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/ryanmurakami/node-semantic-lighting

Node wrapper for the semantic lighting API
https://github.com/ryanmurakami/node-semantic-lighting

Last synced: 4 days ago
JSON representation

Node wrapper for the semantic lighting API

Awesome Lists containing this project

README

        

node-semantic-lighting
======================

Use the [Semantic Lighting API](https://lighting.kitt.ai) in your node projects.

## Installation

Install via npm:

```sh
npm install semantic-lighting
```

## Usage

Include in your projects:

```javascript
var SemLight = require('semantic-lighting');
```

Create a lighting client:

```javascript
var myLight = new SemLight(apiKey, lightsArray);
```

Query the API:

```javascript
myLight.sendCommand('show me barney', callbackFunc);
```

Register a function to be called based on response:

```javascript
function colorHandler(lights, colors) {}

myLight.registerFunction('set_lights_to_color', colorHandler);

myLight.sendCommand('show me pee wee herman');
```