https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=229818

            Bug ID: 229818
           Summary: apm(8) The total battery percentage is incorrect for
                    multiple batteries
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: [email protected]
          Reporter: [email protected]
 Attachment #195185 text/plain
         mime type:

Created attachment 195185
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=195185&action=edit
Produce the total battery percentage from the capacity totals rather than the
other percentages

The total "Remaining battery life" field is the average of the
per-battery "Remaining battery life" fields, rather than the
percentage of the remaining battery life relative to the
maximum battery life.

Contrived expected output:

        APM version: 1.2
        APM Management: Disabled
        AC Line status: off-line
        Battery Status: high
        Remaining battery life: 50%
        Remaining battery time:  4:00:00
        Number of batteries: 2
        Battery 0:
                Battery Status: high
                Remaining battery life: 100%
                Remaining battery time:  3:00:00
        Battery 1:
                Battery Status: low
                Remaining battery life: 20%
                Remaining battery time:  1:00:00

Contrived example output:

        APM version: 1.2
        APM Management: Disabled
        AC Line status: off-line
        Battery Status: high
        Remaining battery life: 60%
        Remaining battery time:  4:00:00
        Number of batteries: 2
        Battery 0:
                Battery Status: high
                Remaining battery life: 100%
                Remaining battery time:  3:00:00
        Battery 1:
                Battery Status: low
                Remaining battery life: 20%
                Remaining battery time:  1:00:00


The included patch changes the way that value is generated to be from
the sum-totals of the current and last-full battery capacities.  This
replaces the current behavior of averaging the percentages produced from
each battery.

The included patch was tested on an amd64 version of
FreeBSD 12.0-CURRENT r336075.  It builds and runs
without any warnings nor errors.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to