Allow overriding charge limit and charge full
TODO:
- [x] Allow overriding charge limit
- [x] Add removing charge limits
- [x] Add (UEFI) docs
I've tested the branch and the behavior is somewhat different than what I've originally expected:
- After running the command the system does charge the battery to 100%, however after unplugging the power and replugging it, it seems that the system still tries to charge the battery.
- The system also tries to charge the battery past the previously set charge limit after the battery charge has fallen under the previously set charge limit.
I expect the charge limit will be restored after the power source is disconnected after the battery capacity has reached 100%, however, it seems that to restore the charge limit settings one has to:
- Run the
--charge-limitcommand to manually set the charge limit back. - Reboot the system so that the firmware will reset the settings.
I would assume that the behavior I imagined might require implementation in the EC firmware as well and is out-of-scope of this project, though.
Thanks for testing! I have to think about that for a bit. At the very least it's worth documenting how exactly it behaves.
FWIW, the current behaviour is closer to what I'd expect: I'd be surprised if unplugging and reconnecting the power cable changed the charging behaviour. If anything, I'd have expected changing the settings to persist after a reboot as well as after reconnecting the power supply.
I think this is mostly an argument for there being no obviously "correct" approach, but however it does work should be documented.
I expect the charge limit will be restored after the power source is disconnected after the battery capacity has reached 100%, however, it seems that to restore the charge limit settings one has to:
That is the intended behavior when it was implemented on our first generation Laptop, it seems we have a regression.
Currently it seems this command is not more useful than setting the charge limit to 100%
We'll work on fixing it in the EC. But prioritizing current regressions on battery-extender/charg-limit.