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

feature: maintain battery in a certain range #227

Closed
wants to merge 5 commits into from

Conversation

tangb4c
Copy link

@tangb4c tangb4c commented Jan 21, 2024

Allow battery tool to maintain battery between in a certain range.
Syntax: battery maintain min-max
Battery tool turn off charging above the maximum value, and on below the minimum value.
eg: battery maintain 20-70
eg: battery maintain 30-30

@tangb4c tangb4c changed the title new CLI feature: maintain battery in a certain range feature: maintain battery in a certain range Jan 22, 2024
@Lonec-L
Copy link

Lonec-L commented Jan 31, 2024

Possibly closes #222

FlyfishO25

This comment was marked as outdated.

@Ben7on
Copy link

Ben7on commented Feb 7, 2024

stop it when it's higher than lower_thres

According to this if condition, It seems it will stop only once it's higher than upper_threshold

if [[ "$battery_percentage" -ge "$upper_threshold" && "$is_charging" == "enabled" ]]; then

@FlyfishO25
Copy link

Yeah, forgive my misunderstanding, your code is correct :)

battery.sh Outdated Show resolved Hide resolved
@tangb4c
Copy link
Author

tangb4c commented Mar 22, 2024

@actuallymentor do you have time to merge this MR?

@actuallymentor
Copy link
Owner

Thanks a lot for your work @tangb4c! And apologies for my late response. My response times vary a lot depending on how busy work is :)

The only request I have is to add a few extra comments explaining what your code does. I like to leave many comments so that new contributors can easily figure out what things do.

Please tag me when you added them and I will gratefully merge!

@FeeJai
Copy link

FeeJai commented Mar 24, 2024

+1. May I request a GUI feature for this too?

@seefood
Copy link

seefood commented Mar 31, 2024

@tangb4c are you adding the remarks or would you like some 3rd party help with an update PR? :)

@tangb4c
Copy link
Author

tangb4c commented Apr 9, 2024

@tangb4c are you adding the remarks or would you like some 3rd party help with an update PR? :)

@seefood Do me a favor, pls, :D

@actuallymentor
Copy link
Owner

Closing so we can keep this central in #261, if that was in error let me know!

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.

7 participants