Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

litra-glow

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

litra-glow

A driver for controlling your Logitech Litra Glow light from a CLI or your JavaScript code

  • 2.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by200%
Maintainers
1
Weekly downloads
 
Created
Source

Logitech Litra Glow

This JavaScript driver allows you to control your Logitech Litra Glow light using a CLI and from your JavaScript code.

With this driver, you can:

  • Turn your light on and off
  • Set the brightness of your light
  • Set the temperature of your light

Compatibility

This library is only tested on macOS Monterey (12.5). It's powered by node-hid, which is compatible with other macOS versions, Windows and Linux, so it would be expected to work there too, but your milage may vary 🙏

Using as a command line tool

Make sure you have Node.js available on your machine, and then install the package with npm install -g litra-glow.

With the package installed, use the litra-on and litra-off commands to turn your light on and off.

Using as a JavaScript library

Installation

Simply add the litra-glow Node.js package to your package.json and install it:

npm install --save litra-glow

Usage

Checking if a Litra Glow is plugged in

The findDevice function checks your computer to find whether a Logitech Litra Glow is plugged in.

If it is, it returns an object representing the device, which you can pass into other function. If it isn't, it returns null.

import { findDevice } from 'litra-glow';

const device = findDevice();

if (device) {
  // Do something
} else {
  // Blow up
}

If you're a huge fan of the Litra Glow and you have multiple plugged in at the same time, it'll return whatever one it happens to find first.

Turning your Litra Glow on or off

Find your device with findDevice, and then use the simple turnOn and turnOff functions. They just take one parameter: the device.

import { findDevice, turnOff, turnOn } from 'litra-glow';

const device = findDevice();

// Turn your light on, then turn it off again after 5 seconds
if (device) {
  turnOn(device);
  setTimeout(() => turnOff(device), 5000));
}
Setting the brightness of your Litra Glow

You can set the brightness of your Litra Glow, measured in Lumen, using the setBrightnessInLumen function. The Litra Glow supports brightness between 20 and 250 Lumen:

import { findDevice, setBrightnessInLumen } from 'litra-glow';

const device = findDevice();

if (device) {
  setBrightnessInLumen(device, 150);
}

You can also set brightness level to a percentage with setBrightnessPercentage if you don't want to think in Lumen:

import { findDevice, setBrightnessPercentage } from 'litra-glow';

const device = findDevice();

if (device) {
  setBrightnessPercentage(device, 75);
}
Setting the temperature of your Litra Glow

You can set the temperature of your Litra Glow, measured in Kelvin, using the setTemperatureInKelvin function. The Litra Glow supports temperature between 2700 and 6500 Kelvin:

import { findDevice, setTemperatureInKelvin } from 'litra-glow';

const device = findDevice();

if (device) {
  setTemperatureInKelvin(device, 4500);
}

You can also set brightness level to a percentage with setTemperaturePercentage if you don't want to think in Lumen:

import { findDevice, setTemperaturePercentage } from 'litra-glow';

const device = findDevice();

if (device) {
  setTemperaturePercentage(device, 75);
}

FAQs

Package last updated on 19 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc