bat: added power_now support

Looks like current_now will eventually be deprecated. Thanks to Conrad
Calmez for finding this bug report:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=532000
This commit is contained in:
Adrian C. (anrxc) 2011-02-15 03:49:43 +01:00
parent fd0718e3f8
commit 6ddad318e0
1 changed files with 3 additions and 1 deletions

View File

@ -57,7 +57,9 @@ local function worker(format, warg)
-- Get charge information
if battery.current_now then
rate = battery.current_now
else -- Todo: other rate sources, as with capacity?
elseif battery.power_now then
rate = battery.power_now
else
return {state, percent, "N/A"}
end