Skip to content

Improve accuracy when stopping charging#241

Merged
actuallymentor merged 3 commits intoactuallymentor:mainfrom
thdrmrphy:accuracy-fix
Jun 28, 2024
Merged

Improve accuracy when stopping charging#241
actuallymentor merged 3 commits intoactuallymentor:mainfrom
thdrmrphy:accuracy-fix

Conversation

@thdrmrphy
Copy link
Copy Markdown
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
Copy Markdown
Owner

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

@thdrmrphy
Copy link
Copy Markdown
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
Copy Markdown
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