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

Better on off params #66

Merged
merged 2 commits into from
Jun 18, 2024
Merged

Conversation

JosuGZ
Copy link
Contributor

@JosuGZ JosuGZ commented May 26, 2024

Enabling the BHO feature is confusing, as writing "true" will return state == "on" => false, thus disabling BHO. I was thinking there was a problem with the feature itself.

Having an enum that only takes "on" or "off" should avoid this confusion.

This is also implemented on the "sinc" feature (which I guess is gsync?).

@phush0
Copy link
Collaborator

phush0 commented Jun 3, 2024

Sync is to sync battery and ac profiles. It is not connected with G-SYNC

@JosuGZ
Copy link
Contributor Author

JosuGZ commented Jun 3, 2024

Thanks! I didn't knew. I still think it makes more sense to have clap validate that the input is either on or off.

Here is how it looks:

$ razer-cli write bho --help
Set battery health optimization

Usage: razer-cli write bho <STATE> [THRESHOLD]

Arguments:
  <STATE>      [possible values: on, off]
  [THRESHOLD]  charging threshold

Options:
  -h, --help  Print help
$ razer-cli write sync --help
Set sync

Usage: razer-cli write sync <SYNC_STATE>

Arguments:
  <SYNC_STATE>  [possible values: on, off]

Options:
  -h, --help  Print help

@dleviminzi
Copy link
Collaborator

Thanks! I didn't knew. I still think it makes more sense to have clap validate that the input is either on or off.

Here is how it looks:

$ razer-cli write bho --help
Set battery health optimization

Usage: razer-cli write bho <STATE> [THRESHOLD]

Arguments:
  <STATE>      [possible values: on, off]
  [THRESHOLD]  charging threshold

Options:
  -h, --help  Print help
$ razer-cli write sync --help
Set sync

Usage: razer-cli write sync <SYNC_STATE>

Arguments:
  <SYNC_STATE>  [possible values: on, off]

Options:
  -h, --help  Print help

This seems like a good idea to me.

@phush0 phush0 merged commit 994bc72 into Razer-Linux:main Jun 18, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants