npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

litra-glow-all-devices

v1.2.0

Published

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

Downloads

6

Readme

Logitech Litra Glow

This JavaScript driver allows you to control your Logitech Litra Glow light using a CLI and from your JavaScript code. The Fork extends the Driver for compatibility for multiple Litra Glow and the behavior for the Brightness and Temperature for cli.

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 tested on Windows. 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-all-devices.

With the package installed, use the litra-on and litra-off commands to turn your light on and off.
The litra-temp <tempAsPercent> for setting the temperature e.g. litra-temp 75.
The litra-bright <tempAsPercent> for setting the temperature e.g. litra-bright 75.

Using as a JavaScript library

Installation

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

npm install --save litra-glow-all-devices

Usage

Checking if a Litra Glow is plugged in

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

If it is, it returns an object array representing all found devices, which you can pass into other function. If it isn't, it returns null.

import { findAllDevices } from 'litra-glow-all-devices';

const devices = findAllDevices();

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

Turning your Litra Glow on or off

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

import { findAllDevices, turnOff, turnOn } from 'litra-glow-all-devices';

const devices = findAllDevices();

// Turn your light on, then turn it off again after 5 seconds
if (devices) {
  turnOn(devices);
  setTimeout(() => turnOff(devices), 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 { findAllDevices, setBrightnessInLumen } from 'litra-glow-all-devices';

const devices = findAllDevices();

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

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

import { findAllDevices, setBrightnessPercentage } from 'litra-glow-all-devices';

const devices = findAllDevices();

if (devices) {
  setBrightnessPercentage(devices, 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 { findAllDevices, setTemperatureInKelvin } from 'litra-glow-all-devices';

const devices = findAllDevices();

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

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

import { findAllDevices, setTemperaturePercentage } from 'litra-glow-all-devices';

const devices = findAllDevices();

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