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

Estimate accurate battery level for rechargable devices #2745

Merged
merged 2 commits into from
Jan 2, 2025

Conversation

MattHag
Copy link
Collaborator

@MattHag MattHag commented Jan 1, 2025

Replace 10% steps with an interpolated percentage calculation.

Fixes #2744

@MattHag
Copy link
Collaborator Author

MattHag commented Jan 1, 2025

I hope there are Logitech devices, that take advantage of it.

@MattHag MattHag requested a review from pfps January 1, 2025 21:48
Copy link
Collaborator

@pfps pfps left a comment

Choose a reason for hiding this comment

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

This is only for rechargeable batteries, as far as I can tell. This should be stated somewhere in the commit description.

Copy link
Collaborator

@pfps pfps left a comment

Choose a reason for hiding this comment

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

See previous comment.

@MattHag MattHag changed the title Estimate accurate battery level in percent Estimate accurate battery level for rechargable devices Jan 2, 2025
@MattHag MattHag force-pushed the accurate_battery_level branch from ec0cc6a to 98f7283 Compare January 2, 2025 14:29
Test battery level estimation with sharp edges based on predefined
steps. Rename variable for clarity and add type hints.

Related pwr-Solaar#2744
Estimate remaining battery based on measured battery voltage. Use linear
interpolation to achieve a smooth line instead of 10 percent jumps.

Fixes pwr-Solaar#2744
@MattHag MattHag force-pushed the accurate_battery_level branch from 98f7283 to e19f129 Compare January 2, 2025 14:29
@MattHag
Copy link
Collaborator Author

MattHag commented Jan 2, 2025

Update commit message

@pfps pfps merged commit bd00cc9 into pwr-Solaar:master Jan 2, 2025
5 checks 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.

Battery levels: More accurate battery percentage based on linear approximation
2 participants