Control Elgato Key Lights with Javascript!
Running npm i elgato-light-api
will install the package. Typescript is natively supported.
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
lightAPI.updateLightOptions(lightAPI.keyLights[0], options).then(() => {
console.log("Lights are all updated to the same value!");
}).catch(e => {
console.error("Error: ", e);
});
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
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!