kharyam / go-litra-driver

Go implementation of a CLI and UI to control Logitech Litra Glow and Beam
GNU General Public License v3.0
24 stars 1 forks source link

Add ability to toggle the light or check its status? #19

Open andrewheiss opened 2 weeks ago

andrewheiss commented 2 weeks ago

Thanks for this tool! It makes working with the Litra so much easier!

I'm interested in using the CLI command to toggle the light with a global keyboard shortcut (like with Raycast or Alfred on macOS).

Right now, I have two separate shell script wrappers: one to run lcli on and one to run lcli off. There is no lcli toggle option (or equivalent) command, so I tried to create conditional logic within a shell script, looking at the output to determine if the previous command turned the light on or off, but the message is the same for both commands:

❯ lcli on
10:48AM DBG Found device Litra Glow

❯ lcli off
10:48AM DBG Found device Litra Glow

Is there a way to get the current status of the light for working with conditional logic in other applications?


Or more simply, I'd love to be able to use one of these approaches:

kharyam commented 2 weeks ago

The utility can't read the current state of the light from the device, however some state information is stored in a config file as the utility is used (i.e., preset settings and current settings for brightness and temp). It doesn't track the on/off state, but it can be added and used to implement a toggle function.