1.0.6 • Published 2 years ago

elgato-light-api v1.0.6

Weekly downloads
4
License
MIT
Repository
github
Last release
2 years ago

Elgato Light API

Control Elgato Key Lights and Light Strips with Javascript!

Installation

Running npm i elgato-light-api will install the package. Typescript is natively supported.

How to use

Create a new instance of ElgatoLightAPI:

const lightAPI = new ElgatoLightAPI();

An Event Emitter is used to notify listeners when a new Key Light is detected.

lightAPI.on('newLight', (newLight: KeyLight) => {
    console.log(newLight.name);
});

Currently, ElgatoLightAPI has two main functions, updateLightOptions and updateAllLights. And an exposed Array keyLights

UpdateLightOptions

lightAPI.updateLightOptions(lightAPI.keyLights[0], options).then(() => {
    console.log("Lights are all updated to the same value!");
}).catch(e => {
    console.error("Error: ", e);
});

UpdateAllLights

lightAPI.updateAllLights(options).then(() => {
    console.log("Lights are all updated to the same value!");
}).catch(e => {
    console.error("Error: ", e);
});

The interfaces required can all be found in KeyLight.ts

Feedback or Issues

This was a quick project to allow for easier control over my Keylights, if you find any issues or have feedback feel free to create an issue about it here.

If you'd like to add any features or fix any bugs you may find submit a PR!