Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
andrewheiss opened this issue Nov 10, 2024 · 1 comment
Open

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

andrewheiss opened this issue Nov 10, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@andrewheiss
Copy link

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:

  • Native toggling support: Something like lcli toggle, where lcli handles the conditional parts of checking if the light is on/off and doing the reverse

  • Light status: Something like lcli status where lcli emits diagnostic information about what the light is doing. Perhaps something like this?

    When off:

    ❯ lcli status
    10:14AM DBG Found device Litra Glow:
    
    - Status: off
    

    When on:

    ❯ lcli status
    10:14AM DBG Found device Litra Glow:
    
    - Status: on
    - Brightness: 80
    - Temperature: 5500
    
@kharyam kharyam self-assigned this Nov 11, 2024
@kharyam kharyam added the enhancement New feature or request label Nov 11, 2024
@kharyam
Copy link
Owner

kharyam commented Nov 11, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants