ACPI time remaining
Richard Hughes
ee21rh at surrey.ac.uk
Mon Feb 7 12:19:27 PST 2005
On Mon, 07 Feb 2005 14:07:50 -0500, David Zeuthen wrote:
>> For this we need a battery.rechargeable.rate (int) key in HAL.
> Not sure APM exports this. Better make this optional.
Yes sorry, that's what I meant. Need as in "have the option to use"
>> Time to discharge (m) = remaining (mWh) / rate (mW) * 60 Time to charge
>> (m) = (max_capacity (mWh) - remaining) / (rate * 60)
> Which looks like one approximation, sure let's go for that to begin
> with.
Isn't it the best to use in this situation? I could see how a running
average (or difference of squares) over N might be a better (even though
rate is discrete) w.r.t processor load, but isn't that overkill?
>> Also on the topic, what about making the key
>> *battery.charge_level.percentage* mandatory? It would make the
>> applications much easier to code, and we could always rely on this
>> value, and not have to have "special cases" for things (the whole idea
>> of an abstract interface...)
>
> No, I think it's just current/maximum, something most applications
> should be expected to do :-)
Okay. I'm just thinking of how an example applet, say battstat could get
the information from HAL with minimal intelligence.
>> Note: this is quite a simple formula. My ideas are changing about the
>> battery.time_to_discharge idea. Maybe it should be in the HAL addon.
>
> You need to poll for battery status on ACPI anyway, so just put it in
> the main hald code for now.
I thought the addon would use the acpi event interfaces as discussed
earlier? I can knock up a quick and dirty addon to do this if you so
desire.
> Sure, got a patch? :-)
You've already added battery.remaining_time.... if you mean for the other
stuff then it's here:
http://hughsie.no-ip.com/write/hal/battery-rate.patch
Richard.
--
http://www.hughsie.com/PUBLIC-KEY
_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal
More information about the Hal
mailing list