X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/6f01d292de214bd81a6487cea4001a91a77fbc66..86432aa3a2f8c6437ec47e5dd88b110612329e6e:/widgets/bat.lua?ds=sidebyside diff --git a/widgets/bat.lua b/widgets/bat.lua index 62016d7..e9ed928 100644 --- a/widgets/bat.lua +++ b/widgets/bat.lua @@ -99,12 +99,12 @@ local function worker(args) bat_now.n_status[i] = first_line(bstr .. "/status") or "N/A" sum_rate_current = sum_rate_current + (rate_current or 0) - sum_rate_voltage = sum_rate_voltage + rate_voltage + sum_rate_voltage = sum_rate_voltage + (rate_voltage or 0) sum_rate_power = sum_rate_power + (rate_power or 0) - sum_rate_energy = sum_rate_energy + (rate_power or ((rate_voltage * rate_current) / 1e6)) + sum_rate_energy = sum_rate_energy + (rate_power or (((rate_voltage or 0) * (rate_current or 0)) / 1e6)) sum_energy_now = sum_energy_now + (energy_now or 0) - sum_energy_full = sum_energy_full + energy_full - sum_energy_percentage = sum_energy_percentage + energy_percentage + sum_energy_full = sum_energy_full + (energy_full or 0) + sum_energy_percentage = sum_energy_percentage + (energy_percentage or 0) end end