framework-system icon indicating copy to clipboard operation
framework-system copied to clipboard

Allow overriding charge limit and charge full

Open JohnAZoidberg opened this issue 1 year ago • 5 comments

TODO:

  • [x] Allow overriding charge limit
  • [x] Add removing charge limits
  • [x] Add (UEFI) docs

JohnAZoidberg avatar Nov 26 '24 10:11 JohnAZoidberg

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-limit command 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.

brlin-tw avatar Nov 28 '24 15:11 brlin-tw

Thanks for testing! I have to think about that for a bit. At the very least it's worth documenting how exactly it behaves.

JohnAZoidberg avatar Dec 02 '24 16:12 JohnAZoidberg

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.

me-and avatar Mar 08 '25 16:03 me-and

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%

JohnAZoidberg avatar Mar 15 '25 04:03 JohnAZoidberg

We'll work on fixing it in the EC. But prioritizing current regressions on battery-extender/charg-limit.

JohnAZoidberg avatar Mar 18 '25 02:03 JohnAZoidberg