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

new CLI feature: maintain battery in a certain range #261

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

seefood
Copy link

@seefood seefood commented Apr 9, 2024

Actually #227 by @tangb4c with some code improvements and inline comments

@actuallymentor
Copy link
Owner

Thanks for the addition Seefood!

If I read this correctly, the while loop has no throttling so would be running in very rapid succession. Was that a design decision?

@seefood
Copy link
Author

seefood commented Jun 28, 2024

There's a 1 minute sleep there at the end of the while loop, so battery levels are sampled once a minute. Do you feel it should be more like 5 minutes?

@enricodelarosa
Copy link

Hi,

Just wanted to ask if PR is just waiting for the loop throttle/sleep fix or resolution?

if [[ "$lower_threshold" -lt 1 ]] || [[ "$lower_threshold" -gt 100 ]] ||
[[ "$upper_threshold" -lt 1 ]] || [[ "$upper_threshold" -gt 100 ]] ||
[[ "$lower_threshold" -gt "$upper_threshold" ]]; then
log "Error: $setting is not a valid range setting for battery maintain. The min/max value should between 1 and 100. A range example like 30-80"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The min/max value should be between 1 and 100.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⏱️ waiting Waiting for response
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants