Display time remaining to fill/empty the battery in the notification when the ac adapter is plugged/unplugged.
Needs ReviewPublic

Authored by meven on Apr 12 2019, 1:19 PM.

Details

Reviewers
broulik
ngraham
Group Reviewers
Plasma
VDG
Summary

Improve the notification when the ac adapter is plugged/unplugged.
Displaying direcly in them the time remaining to empty or fill the battery is quite more informative.

Test Plan

When AC is plugged:

When AC is unplugged:

Diff Detail

Repository
R122 Powerdevil
Branch
arcpatch-D20492
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 10795
Build 10813: arc lint + arc unit
meven created this revision.Apr 12 2019, 1:19 PM
Restricted Application added a project: Plasma. · View Herald TranscriptApr 12 2019, 1:19 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
meven requested review of this revision.Apr 12 2019, 1:19 PM
meven retitled this revision from [WI] Display time remaining to fill/empty the battery in the notification when the ac adapter is plugged/unplugged. to [WIP] Display time remaining to fill/empty the battery in the notification when the ac adapter is plugged/unplugged..Apr 12 2019, 3:20 PM

Screenshots would be nice. :)

ngraham edited reviewers, added: Plasma, broulik; removed: Plasma: Workspaces.Apr 12 2019, 5:14 PM
meven added a comment.Apr 12 2019, 6:14 PM

Screenshots would be nice. :)

That's my intent, we can yet talk about wording.

I can now move forward after recompiling everything...

ngraham added inline comments.Apr 12 2019, 6:32 PM
daemon/powerdevilcore.cpp
635

Remaining charging time: %s

638

Charge level: %s%

646

Remaining battery life: %s

649

Charge level: %s%

meven updated this revision to Diff 56113.Apr 13 2019, 8:32 AM

Improve wording

meven marked 4 inline comments as done.Apr 13 2019, 8:32 AM
meven updated this revision to Diff 56123.Apr 13 2019, 9:46 AM

Fix formatting of details

meven updated this revision to Diff 56125.Apr 13 2019, 10:28 AM

No need to keep stored localy the batterRemainingTime

When AC is plugged:

When AC is unplugged:

I have noticed that sometimes the remaining time is not available.
In which case the percent is used, but I haven't tested this case properly.

Also I hesitate to always include the percent in those notifications.

meven retitled this revision from [WIP] Display time remaining to fill/empty the battery in the notification when the ac adapter is plugged/unplugged. to Display time remaining to fill/empty the battery in the notification when the ac adapter is plugged/unplugged..Apr 13 2019, 10:32 AM
meven edited the test plan for this revision. (Show Details)

Also I'd like to display the duration naturally like "1 hour 30 minutes" instead of "1:30" as it does currently.
Could someone point me to the right Kcore/KLocale feature for this ?
I have done a little research but haven't found any, perhaps we are lacking the feature.

meven edited the test plan for this revision. (Show Details)Apr 13 2019, 10:38 AM
ngraham added a reviewer: VDG.Apr 15 2019, 3:23 AM

These are notifications that aren't shown by default, right?

meven added a comment.EditedApr 15 2019, 7:56 AM

These are notifications that aren't shown by default, right?

I believe so, and that the plugged out event is notified by a sound by default. But I am not sure at the moment.

But with this feature they become quite more useful, especially the plugged out notification. It could be worse it to make it visible by default.

I personally dislike sound notifications and I suspect I am not the only one.

The feature is a piggyback feature from macOS.

I think remaining time is way too unreliable for this. We first need a way to calculate a moving average before showing it i this context imho

meven added a comment.Apr 16 2019, 7:08 AM

I think remaining time is way too unreliable for this. We first need a way to calculate a moving average before showing it i this context imho

How come this be be good enough for the battery applet ? Isn't it more exposed in this context ?

The missing moving average seems to me like a second underlying issue.
The current remainTime is instantaneous true, but informative nonetheless albeit less accurate.
At least it would be coherent everywhere (applet and notification).

Still we don't need to rush this.
Creating a powerdevil bug/task about moving average battery level could be the outcome here.