Proper battery percentage#1398
Conversation
|
I will cut out the hacky rescaling in my low battery warning PR for this. This looks good. |
|
Looks good! I quite like that #585 changes the minimum voltage to 3.5v, which makes it easier to remember to charge the watch on time. Maybe that could be done here as well? |
|
@JF002 I think this PR is ready to be merged into develop. Let me know if I need to run some extra tests before it. I have tested these changes on my dev kit and on a sealed during a few weeks and everything looks good.
|
Removed redundant brackets Co-authored-by: NeroBurner <pyro4hell@gmail.com>
NeroBurner
left a comment
There was a problem hiding this comment.
looking forward to charge my pinetime at 10% instead of at 40% 😃
|
@JF002 It looks like I don't have permissions for merging it. But I believe it is ready for that. Could you provide any steps I need to do next or just merge the PR if you agree with what was done. |
Oh, it looks like I wrote my message with working account. So it was me :-) |
Only me and the member of the @InfiniTimeOrg/core-developers team have write access to the repo :)
Thanks for your contribution! The next step is to wait for us to review the PR, which can take some time (there are a lot of PRs in the backlog, as you can see). There's already another PR that does more of less the same things : #585. How does it compare to this one? |
|
Thank you for your feedback. I saw this PR and agree that it seems to do the same thing. But I found their implementation too complex and more hardcoded to be used only for battery percentage. Also comparing with #585 it doesn't use float pointer numbers, so it should work quicker and take less memory/CPU resources. My changes adds class for approximation any data and anyone can reuse it for something else. Actually I would appreciate merging any of this two PRs, as both of them improve user experience in terms of showing proper battery percentage. |
|
I'm currently collecting battery data from all 3 of my PineTimes, so that the data from multiple batteries can be combined. This should give slightly more accurate results. |
I think this is what I'll eventually do :)
Agreed! |
|
We merged this PR in #1444. |



This PR adds linear approximation util and use it for making battery discharge curve more linear.
These changes were done independently on #585, I guess my solution is more generic. The main idea of my PR is adding linear approximation which might be used in any other feature including this old PR.
I used my own measurements of battery, not sure if they accurate enough, so you are welcome to update my digits:
My measurements:
blue - measured voltage
red - measured percentage (using 1.9.0)
orange - filtered voltage (I'm working on adding filter in another branch)
green - expected percentage using this algorithm (actually data is filtered, but it shows trade line of approximation)
I can share my data by request.