aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian C. (anrxc) <anrxc@sysphere.org>2009-11-10 16:18:39 +0100
committerAdrian C. (anrxc) <anrxc@sysphere.org>2009-11-10 16:18:39 +0100
commiteb661f6e1730a41c0c8426f9682057749d372ad5 (patch)
treef127a75873bed3d644633dc8f764981421a68e0e
parent6fadee6fb577075a6e848fd2b5cdd60417adef6c (diff)
downloadvicious-legacy-eb661f6e1730a41c0c8426f9682057749d372ad5.tar.xz
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?
-rw-r--r--batsys.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/batsys.lua b/batsys.lua
index 0118c82..95d26af 100644
--- a/batsys.lua
+++ b/batsys.lua
@@ -62,11 +62,14 @@ local function worker(format, batid)
-- Get charge information
- if battery.current_now then rate = battery.current_now
- else return {state, percent, "N/A"} end
+ if battery.current_now then
+ rate = battery.current_now
+ else -- Todo: other rate sources, as with capacity?
+ return {state, percent, "N/A"}
+ end
-- Calculate remaining (charging or discharging) time
- if state == "+"then
+ if state == "+" then
timeleft = (tonumber(capacity) - tonumber(remaining)) / tonumber(rate)
elseif state == "-" then
timeleft = tonumber(remaining) / tonumber(rate)