Whilst on this topic..
.. for a while now I've been using a bash script to control the charging of a laptop.
Script monitors the limits set for chsrge/low charge - signals one of the house pis equipped with remote control board that can turn (4) on/off mains sockets - laptop thus kept within limits. Anyone care to suggest what the limits should be ?? . I'm using 55%-85% at the moment so that there is a reasonable reserve for off-mains running. Of course you need a scripted way of turning off charging before hibernation etc.
Using this on an older laptop has kept the battery capacity at 96% after 4 years.
If you have a spare pi the remote sockets are useful for all sorts of things and very cheap