[PATCH] fix battery keys if battery is full charged

Danny Kukawka danny.kukawka at web.de
Thu Aug 11 00:15:07 PDT 2005


On Thursday 11 August 2005 01:39, David Zeuthen wrote:
> On Thu, 2005-08-11 at 00:30 +0200, Danny Kukawka wrote:
> > Hi,
> >
> > this is a patch to fix battery keys, if battery is full charged. This
> > prevent to have keys in HAL, which are in
> > /proc/acpi/battery/*/{info,state} already 'unknown' e.g. 'present rate'.
> > The patch base on the other ACPI fixes again ;-)
> >
> > Remove some keys in battery_refresh_poll() befor read them from
> > /proc/acpi/battery/*/{info,state} to be sure that hal not provides a key
> > if the related value is unknown.
>
> I think we should just set these to 0 instead of removing them.
> Reasoning is that the current is really zero (no energy is flowing),
> plus it'll make client code much easier, don't you think?

O.k. I prefer to provide only keys for things we know, but to set them to a 
default value if the related entry in /proc/acpi/battery/*/{info,state} is 
unknown is also o.k. for me. But I would propose to set such keys to -1 to 
know that the real values are currently unknown. What you think?

I'll rework the patch.

Cheers,

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



More information about the Hal mailing list