Created attachment 167043 [details] add hw.acpi.battery.rate sysctl oid Patch attached introduces a sysctl to display the discharging rate of a battery. It seems to me (but, I'm not particularly sure) that the info populated into &acpi_battery_battinfo.rate is -always- converted to Watts (cf acpi_battery_get_battinfo() lines 202-203. So we could probably append "mW" to the output, however I'm quite fond of having it be an integer for the purposes of extending i3 to read this new sysctl and output it to my status bar. ;-)
Works for me (TP X230): # sysctl hw.acpi.battery.rate hw.acpi.battery.rate: 13834
Please add something to the description to indicate the units of the sysctl (mW?).
Created attachment 167967 [details] add hw.acpi.battery.rate sysctl oid
hrm. Is it mW/second or something? A rate indicates some factor of time.
(In reply to Sean Bruno from comment #4) mW is a rate :).
> Please add something to the description to indicate the units of the sysctl (mW?). Note that acpiconf -i0 reports mW on some systems and mA on others, so I'm not sure that mW is always correct.
(In reply to Ed Maste from comment #6) This should be dealt with by the following code in the same file, if I'm not mistaken: https://svnweb.freebsd.org/base/head/sys/dev/acpica/acpi_battery.c?view=markup#l196
Hence: Yes, you're right - in the case that battery voltage can't be obtained the item stays in mA. What's the best way to solve this in the description?