Merge pull request #212 from 0x0d/master

Two bugfixes on Thinkpad X260
This commit is contained in:
Luke Bonham 2016-07-08 11:36:54 +02:00 committed by GitHub
commit 0cfb9187ef
2 changed files with 4 additions and 4 deletions

View file

@ -131,7 +131,7 @@ local function worker(args)
local hours = math.floor(rate_time)
local minutes = math.floor((rate_time - hours) * 60)
bat_now.perc = tonumber(string.format("%d", math.min(100, sum_energy_percentage / #batteries)))
bat_now.perc = tonumber(string.format("%d", math.floor(math.min(100, sum_energy_percentage / #batteries))))
bat_now.time = string.format("%02d:%02d", hours, minutes)
bat_now.watt = tonumber(string.format("%.2f", sum_rate_energy / 1e6))
elseif bat_now.status == "Full" then

View file

@ -128,12 +128,12 @@ local function worker(args)
net_now.sent = string.gsub(string.format('%.1f', net_now.sent), ',', '.')
net_now.received = string.gsub(string.format('%.1f', net_now.received), ',', '.')
widget = net.widget
settings()
net.last_t = total_t
net.last_r = total_r
end
widget = net.widget
settings()
end
helpers.newtimer(iface, timeout, update)