[patch] addon-hid-ups.c : battery.present is mandatory for HAL spec

Richard Hughes hughsient at gmail.com
Mon May 9 09:27:54 PDT 2005


On Mon, 2005-05-09 at 10:40 -0400, David Zeuthen wrote:
> On Mon, 2005-05-09 at 10:38 -0400, David Zeuthen wrote:
> > On Mon, 2005-05-09 at 07:39 +0100, Richard Hughes wrote:
> > > On an unrelated note, how keen are you to put the battery.remaining_time
> > > calculations inside addon-acpi.c? At the moment it does not calculate
> > > this value and leaves it to the application (which is okay, since it's
> > > non-compulsory...).
> > 
> > Okay, I suppose that it would be useful. It would be nice too if
> > battery.remaining_time also was 'number of minutes until battery is
> > fully charged' when battery.is_charging==TRUE.

That's the logic that I'm using now:

if (isCharging)
	minutesRemaining = 
	 ((double) (LastFull - Charge) / (double) Rate) * 60;
else
	minutesRemaining = 
	 ((double) Charge / (double) Rate) * 60;

> Bah, number of seconds. Sorry, still on my first cup.

No problem. I'm trying to wean myself off coffee, and it hurts.

I'll work on a patch.

Thanks, Richard.

_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list