From b031d1c359253d8722163d5457a256e369e3ae20 Mon Sep 17 00:00:00 2001 From: Frans de Jonge Date: Sat, 12 Sep 2020 11:08:26 +0200 Subject: [PATCH] =?UTF-8?q?[Plugin]=20BatteryStat:=20consumed=20=E2=86=92?= =?UTF-8?q?=20charged=20for=20charging=20(#6646)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes . --- plugins/batterystat.koplugin/main.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/batterystat.koplugin/main.lua b/plugins/batterystat.koplugin/main.lua index 8523ed1e2..f0821a65e 100644 --- a/plugins/batterystat.koplugin/main.lua +++ b/plugins/batterystat.koplugin/main.lua @@ -79,8 +79,9 @@ local function shorten(number) return string.format("%.2f", number); end -function Usage:dump(kv_pairs) - table.insert(kv_pairs, {INDENTATION .. _("Consumed %"), shorten(self.percentage)}) +function Usage:dump(kv_pairs, id) + local name = id or _("Consumed %") + table.insert(kv_pairs, {INDENTATION .. name, shorten(self.percentage)}) table.insert(kv_pairs, {INDENTATION .. _("Total time"), util.secondsToHClock(self.time, true, true)}) table.insert(kv_pairs, {INDENTATION .. _("% per hour"), shorten(self:percentagePerHour())}) end @@ -254,7 +255,7 @@ function BatteryStat:dump() self.sleeping:dump(kv_pairs) self.sleeping:dumpRemaining(kv_pairs) table.insert(kv_pairs, {_("During last charge"), ""}) - self.charging:dump(kv_pairs) + self.charging:dump(kv_pairs, _("Charged %")) self.charging:dumpCharging(kv_pairs) table.insert(kv_pairs, {_("Since last charge"), ""}) self.discharging:dump(kv_pairs)