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

Auto calibration support #7

Open
uzza1hossain opened this issue Sep 30, 2023 · 2 comments
Open

Auto calibration support #7

uzza1hossain opened this issue Sep 30, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@uzza1hossain
Copy link

Thanks for the neat and clean package.

It would be excellent to have a system where users can set an interval, let's say 7-days. Afterward, every 7 days, it will automatically charge up to 100 (no matter the limit define by user), then discharge to 15, and finally recharge to the user-defined limit.

The flow will be like.

  1. Keep track of the last calibration.
  2. Check if the last calibration was 7 days ago or more.
  3. If it's been more than 7 days, set the limit to 100%.
  4. When it reaches a 100% charge, disable the adapter.
  5. When it drops to 15%, enable the adapter.
  6. Set the limit to the user-defined value.
  7. Update the last calibration time.
@charlie0129
Copy link
Owner

charlie0129 commented Sep 30, 2023

Good suggestion. I think this feature can be split into two parts:

  1. a cronjob that does the calibration;
  2. do calibration (steps 3-6). for example, using command batt calibrate;

Part 1 can be done using a external cronjob that calls batt calibrate every X days. batt itself should only do part 2. I would prefer to call batt calibrate manually instead of automatically to avoid auto-calibration when I really need to use my computer :) Or a GUI that regularly reminds the user of calibration and let the user decide wether to do calibration now. So I think we can implement part 2 first.

If we were to implement it, some extra consideration might be needed. For example, to make it hassle-free, we also need to consider edge cases like: what if the computer sleeps/restarts during calibration? will the intermediate state cause any problems? I haven't really planned yet, these are just some initial thoughts come to my mind.

@charlie0129 charlie0129 added the enhancement New feature or request label Sep 30, 2023
@uzza1hossain
Copy link
Author

Yes. You can split this feature into two parts.
Implement the second part first and let's see how it's goes. There is no need of GUI for starting.
Just second part of feature, do calibration (steps 3-6) exposed via a command batt calibrate
Looking forward to next release 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants