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

Improve accuracy when stopping charging #241

Merged
merged 3 commits into from
Jun 28, 2024

Conversation

thdrmrphy
Copy link
Contributor

I've noticed that because the script only runs every 60 seconds, and my computer usually does more than
a 1% increase in that time, I'll often end up 1-2% over the limit.

To fix this, this PR sleeps the script for 20 instead of 60 within 3% of the target.

@actuallymentor
Copy link
Owner

Ah I like that approach to improving the accuracy. Have you tested this in the wild?

@thdrmrphy
Copy link
Contributor Author

thdrmrphy commented Mar 27, 2024

I've not tested this yet in the wild.

I thought I had, but there were some major errors in the code. When I went to fix them, I found some really bad bugs with the rest of the code that would put the computer into an eternal, inescapable loop where charging could not be enabled.

Long story short, hopefully I'll be submitting another PR soon to fix that, before I can work on this.

@thdrmrphy thdrmrphy marked this pull request as draft April 5, 2024 06:45
@thdrmrphy thdrmrphy mentioned this pull request Apr 5, 2024
@thdrmrphy
Copy link
Contributor Author

Most of this is in #253 now, so I've made this PR a draft and I'm happy to close it down the line if it's not needed.

@actuallymentor actuallymentor merged commit 9a4f4f3 into actuallymentor:main Jun 28, 2024
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.

2 participants