since a fully charged battery would sometimes drop the charge rate
to 0. This happens at least on the submitter's and my laptops.
patch from ymous anonimo
machines so we can't use that to detect ac-power. for now, revert to what
we were doing before.
XXX perhaps acpiacad should be used if it exists, and if it doesn't fall
XXX back to using "acpibat.*discharging". then people with broken acpiacad
XXX can simply not include that driver in their kernel, but worry about
XXX that again after pkgsrc freeze.
also, check __NetBSD_Version__ to see when various envsys(4) API changes
occured, and avoid using new methods on old systems. this should fix PR#23355.
that we're not on AC power via the acpiacad's 'disconnected' entry, not
one of the battery's "discharging" entries, as the latter may be true
even while on AC power.
doesn't work, try to use ACPI to get the battery charge value, and AC
charging switch.
Known to work on my Sony VAIO (PCG-GRX315MP) with ACPI, and with thanks to:
Lubomir Sedlacik for testing on an IBM T22 with ACPI
Manuel Bouyer for testing on an IBM Thinkpad 600e with APM, and
Brian A. Seklecki for testing on a Sony PCG-R505