Adding support for batteries without energy_now and energy_full. #18

Merged
merged 1 commit into from Oct 29, 2013

Projects

None yet

2 participants

@jmatth
Contributor
jmatth commented Oct 23, 2013

Apparently not all systems have these values in /sys/class/power_supply, so the battery meter doesn't work. In the ACPI source code they use current_now and charge_now to calculate time remaining if other values aren't available, so I just ported that calculation and set it up to use that as a fallback.

I don't actually have a system where energy_now and energy_full exist, so I'd suggest testing this code on such a system to make sure it still works as expected. I'm not 100% confident in my Perl grep skills 😐.

@jmatth jmatth Adding support for batteries without energy_now and energy_full.
If these values are not available it will try to use charge_now and
current_now instead.
5397d00
@creaktive creaktive merged commit d63ba92 into creaktive:master Oct 29, 2013
@creaktive
Owner

Fortunately, I have such a system :)
Tested, still working fine! Thanks for the patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment