Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Battery plugin: "Consumed" in charging #6057

Closed
mergen3107 opened this issue Apr 15, 2020 · 1 comment · Fixed by #6646
Closed

Battery plugin: "Consumed" in charging #6057

mergen3107 opened this issue Apr 15, 2020 · 1 comment · Fixed by #6646
Assignees
Milestone

Comments

@mergen3107
Copy link
Contributor

  • KOReader version: 2020.03.02
  • Device: Kindle PW3 (5.9.7)

Issue

Battery plugin says Consumed in the During last charge section.
It should be Charged instead.
Reader_2020-Apr-12_135629

@pazos
Copy link
Member

pazos commented Apr 17, 2020

Battery plugin says Consumed in the During last charge section.
It should be Charged instead.

i didn't check your statement.If true you can fix it with

--- 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)

@pazos pazos added this to the 2020.07 milestone Jun 27, 2020
@pazos pazos self-assigned this Jun 27, 2020
@Frenzie Frenzie modified the milestones: 2020.07, 2020.08 Jul 18, 2020
@Frenzie Frenzie modified the milestones: 2020.08, 2020.09 Aug 17, 2020
Frenzie added a commit to Frenzie/koreader that referenced this issue Sep 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants