Skip to content
This repository has been archived by the owner on Aug 6, 2024. It is now read-only.

Offer a command-line interface to allow other apps to trigger power mode, etc #6

Open
ViRb3 opened this issue Mar 13, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@ViRb3
Copy link
Owner

ViRb3 commented Mar 13, 2021

This will help people who want to develop apps that rely on controlling the hardware features that this app controls. Examples:

@tkon99
Copy link

tkon99 commented Aug 5, 2021

FYI, it's my first time doing this but I've managed to get a basic CLI working for BatteryMode: tkon99@cdcea5d

@Soham-Rakhunde
Copy link

@tkon99 hello, can I know where to learn using CLI and especially how did u find vantage features.I mean i wanted to program that everytime I start my legion it should ayto start keyboard backlight and start the conservation mode at 80 percent auto(matically and its a pain in the ass to start the conservation mode every time from the gui. But I cant find any tool to do this or how to write a program or where to find these vantage features. PLease reply

@tkon99
Copy link

tkon99 commented Aug 21, 2021

@Soham-Rakhunde I don't have time to implement features I will not use, so if you need keyboard LED you will need to implement the CLI yourself.

I also think you misunderstood what I did. Basically the "vantage features" were already implemented in LenovoController (this repo), I then call them from a CLI instead of the GUI so that a script can interface with them. I didn't add new vantage features.

Either way, if you take a look at the code in my fork (link in my comment above) you will find the implementation of the CLI. Adding features can be done by adding a new case in the switch statement. Setting the value of a feature would then be the third argument iirc.

I might implement everything at some point but maybe in a couple months (don't count on it).

PS. I implemented a Python script that gets called every minute by the Windows Task Scheduler (and run as admin), checks the current battery status (charging or not) and then calls the CLI to set the battery mode accordingly (conservation when more than 80 percent).

@Soham-Rakhunde
Copy link

Thank you very much I understood it.
I will look into the repo and i will try to write the feature. Thanks a lot.

@GTMoraes
Copy link

FYI, it's my first time doing this but I've managed to get a basic CLI working for BatteryMode: tkon99@cdcea5d

Hey, I'm using your build and it works ok.
However, when Rapid Mode is enabled, it cannot disengage Rapid Mode through CLI, only enable or disable Conservative mode.
If I use "BatteryMode Normal", it stays in Rapid Mode. If I set to Rapid Mode, then change to Conservative, then try to change to Normal, it goes back to Rapid Mode.
If it's set to Normal and I use CLI to change to Rapid mode, it works. If it's set to Conservative and I use to change to Rapid mode, it works. If it's been previously set to Normal, then I change to Conservative, then change to Normal, it works changing to Normal.

Clicking on the GUI icons works fine to change between the three modes, at any previous state.

My device's a Lenovo Yoga 7i 15ITL5

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

No branches or pull requests

4 participants