bug#39491: 28.0.50; two bugs in battery-upower

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#39491: 28.0.50; two bugs in battery-upower

Eli Zaretskii
> From: [hidden email]
> Date: Sat, 8 Feb 2020 12:10:46 +0400
> Cc: [hidden email], [hidden email],
>  Stefan Monnier <[hidden email]>
>
> >> However, that function has a design flaw: it reports on just the first
> >> battery in the list.  battery-upower-device-list correctly returns a
> >> list with an element for each battery, but battery-upower finds only one
> >> of them (the first one in the list) and ignores the others.
> >>
> >> The old code handle all the batteries and added the energy quantities
> >> so as to report accurately the total power available and overall
> >> fraction of charge.  I wrote that code myself, around 10 years ago.
> >>
> >> Please restore the lost functionality.
> >
> > Evgeny, could you please look into fixing this?
> >
>
> OK, we should generalize multi-battery code then, so each status func won’t reimplement multi battery handling.
>
> I’ll look at it tomorrow

Evgeny, any progress in fixing this?

TIA



Reply | Threaded
Open this post in threaded view
|

bug#39491: 28.0.50; two bugs in battery-upower

Evgeny Zajcev


вс, 26 апр. 2020 г. в 17:47, Eli Zaretskii <[hidden email]>:
> From: [hidden email]
> Date: Sat, 8 Feb 2020 12:10:46 +0400
> Cc: [hidden email], [hidden email],
>  Stefan Monnier <[hidden email]>
>
> >> However, that function has a design flaw: it reports on just the first
> >> battery in the list.  battery-upower-device-list correctly returns a
> >> list with an element for each battery, but battery-upower finds only one
> >> of them (the first one in the list) and ignores the others.
> >>
> >> The old code handle all the batteries and added the energy quantities
> >> so as to report accurately the total power available and overall
> >> fraction of charge.  I wrote that code myself, around 10 years ago.
> >>
> >> Please restore the lost functionality.
> >
> > Evgeny, could you please look into fixing this?
> >
>
> OK, we should generalize multi-battery code then, so each status func won’t reimplement multi battery handling.
>
> I’ll look at it tomorrow

Evgeny, any progress in fixing this?

Sorry for the delay, I have some progress, but not yet ready.  I'm pretty busy these days because I'm working for large company that provides video-streaming service and we experiencing extreme rise in number of the active users and everybody wants to watch something all the day :)

--
lg
Reply | Threaded
Open this post in threaded view
|

bug#39491: 28.0.50; two bugs in battery-upower

Eli Zaretskii
> From: Evgeny Zajcev <[hidden email]>
> Date: Sun, 26 Apr 2020 18:44:09 +0300
> Cc: [hidden email], [hidden email],
> Stefan Monnier <[hidden email]>
>
>  Evgeny, any progress in fixing this?
>
> Sorry for the delay, I have some progress, but not yet ready.  I'm pretty busy these days because I'm working
> for large company that provides video-streaming service and we experiencing extreme rise in number of the
> active users and everybody wants to watch something all the day :)

Thanks, just please don't forget this issue.



Reply | Threaded
Open this post in threaded view
|

bug#39491: 28.0.50; two bugs in battery-upower

Eli Zaretskii
> Date: Sun, 26 Apr 2020 19:53:45 +0300
> From: Eli Zaretskii <[hidden email]>
> Cc: [hidden email], [hidden email], [hidden email]
>
> > From: Evgeny Zajcev <[hidden email]>
> > Date: Sun, 26 Apr 2020 18:44:09 +0300
> > Cc: [hidden email], [hidden email],
> > Stefan Monnier <[hidden email]>
> >
> >  Evgeny, any progress in fixing this?
> >
> > Sorry for the delay, I have some progress, but not yet ready.  I'm pretty busy these days because I'm working
> > for large company that provides video-streaming service and we experiencing extreme rise in number of the
> > active users and everybody wants to watch something all the day :)
>
> Thanks, just please don't forget this issue.

Ping!  Any news on this one?

Thanks.



Reply | Threaded
Open this post in threaded view
|

bug#39491: 28.0.50; two bugs in battery-upower

Evgeny Zajcev


вт, 26 мая 2020 г. в 19:23, Eli Zaretskii <[hidden email]>:
> Date: Sun, 26 Apr 2020 19:53:45 +0300
> From: Eli Zaretskii <[hidden email]>
> Cc: [hidden email], [hidden email], [hidden email]
>
> > From: Evgeny Zajcev <[hidden email]>
> > Date: Sun, 26 Apr 2020 18:44:09 +0300
> > Cc: [hidden email], [hidden email],
> >     Stefan Monnier <[hidden email]>
> >
> >  Evgeny, any progress in fixing this?
> >
> > Sorry for the delay, I have some progress, but not yet ready.  I'm pretty busy these days because I'm working
> > for large company that provides video-streaming service and we experiencing extreme rise in number of the
> > active users and everybody wants to watch something all the day :)
>
> Thanks, just please don't forget this issue.

Ping!  Any news on this one?


I will get spare time very soon, and will come back to this. I did not forget about it :)

--
lg
Reply | Threaded
Open this post in threaded view
|

bug#39491: 28.0.50; two bugs in battery-upower

Richard Stallman
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > How 'bout we revert to the /sys backend as default, in the mean time?

Is that the same code in battery.el that was running last year?
If so, it did the job.

Or is it something different?

--
Dr Richard Stallman
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)





Reply | Threaded
Open this post in threaded view
|

bug#39491: 28.0.50; two bugs in battery-upower

Richard Stallman
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > > Is that the same code in battery.el that was running last year?

  > Yes.

In that case, it fixes the regression that is a problem for me.

I hope the new code will eventually work, but in the mean time,
let's move back to the code that does work.

--
Dr Richard Stallman
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)





Reply | Threaded
Open this post in threaded view
|

bug#39491: 28.0.50; two bugs in battery-upower

Basil L. Contovounesios
tags 39491 + patch
quit

Richard Stallman <[hidden email]> writes:

> [[[ To any NSA and FBI agents reading my email: please consider    ]]]
> [[[ whether defending the US Constitution against all enemies,     ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
>
>   > > Is that the same code in battery.el that was running last year?
>
>   > Yes.
>
> In that case, it fixes the regression that is a problem for me.
>
> I hope the new code will eventually work, but in the mean time,
> let's move back to the code that does work.
The attached patch fixes this regression and adds support for both
multiple power sources and D-Bus status change notifications in
battery-upower.

In a separate patch in bug#41808 I reorder the battery status backends
in order of increasing obsolescence on GNU/Linux: sysfs, ACPI, then APM.

WDYT?  Thanks,

--
Basil


n

0001-Improve-battery.el-UPower-support.patch (23K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

bug#39491: 28.0.50; two bugs in battery-upower

Michael Albinus
"Basil L. Contovounesios" <[hidden email]> writes:

> --- a/test/lisp/battery-tests.el
> +++ b/test/lisp/battery-tests.el
> @@ -48,6 +48,69 @@ battery-linux-proc-apm-regexp
>      (should (equal (match-string 8 str) "1792"))
>      (should (equal (match-string 9 str) "min"))))
>
> +(ert-deftest battery-upower-state ()
> +(ert-deftest battery-upower-state-unknown ()

Shouldn't theses tests be skipped, unless battery-upower is used?
Something like

(skip-unless (eq battery-status-function #'battery-upower))



Reply | Threaded
Open this post in threaded view
|

bug#39491: 28.0.50; two bugs in battery-upower

Basil L. Contovounesios
Michael Albinus <[hidden email]> writes:

> "Basil L. Contovounesios" <[hidden email]> writes:
>
>> --- a/test/lisp/battery-tests.el
>> +++ b/test/lisp/battery-tests.el
>> @@ -48,6 +48,69 @@ battery-linux-proc-apm-regexp
>>      (should (equal (match-string 8 str) "1792"))
>>      (should (equal (match-string 9 str) "min"))))
>>
>> +(ert-deftest battery-upower-state ()
>> +(ert-deftest battery-upower-state-unknown ()
>
> Shouldn't theses tests be skipped, unless battery-upower is used?

No, because they test a pure function that depends only on its
arguments.

--
Basil



Reply | Threaded
Open this post in threaded view
|

bug#39491: 28.0.50; two bugs in battery-upower

Basil L. Contovounesios
In reply to this post by Basil L. Contovounesios
tags 39491 fixed
close 39491 28.1
quit

"Basil L. Contovounesios" <[hidden email]> writes:

> The attached patch fixes this regression and adds support for both
> multiple power sources and D-Bus status change notifications in
> battery-upower.

Pushed to master and boldly closing.

Improve battery.el UPower support
453d30d92c 2020-06-18 13:11:17 +0100
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=453d30d92cbf940567869d4705c1fcfe57725825

--
Basil