batsys: add note about other charge/rate sources
As in capacity case maybe there are other rate sources. Exposed in different files depending on the implementation?
This commit is contained in:
parent
6fadee6fb5
commit
eb661f6e17
|
@ -62,11 +62,14 @@ local function worker(format, batid)
|
||||||
|
|
||||||
|
|
||||||
-- Get charge information
|
-- Get charge information
|
||||||
if battery.current_now then rate = battery.current_now
|
if battery.current_now then
|
||||||
else return {state, percent, "N/A"} end
|
rate = battery.current_now
|
||||||
|
else -- Todo: other rate sources, as with capacity?
|
||||||
|
return {state, percent, "N/A"}
|
||||||
|
end
|
||||||
|
|
||||||
-- Calculate remaining (charging or discharging) time
|
-- Calculate remaining (charging or discharging) time
|
||||||
if state == "+"then
|
if state == "+" then
|
||||||
timeleft = (tonumber(capacity) - tonumber(remaining)) / tonumber(rate)
|
timeleft = (tonumber(capacity) - tonumber(remaining)) / tonumber(rate)
|
||||||
elseif state == "-" then
|
elseif state == "-" then
|
||||||
timeleft = tonumber(remaining) / tonumber(rate)
|
timeleft = tonumber(remaining) / tonumber(rate)
|
||||||
|
|
Loading…
Reference in New Issue