Extra battery properties

Richard Hughes hughsient at gmail.com
Mon Jul 16 01:55:27 PDT 2007


On Thu, 2007-07-05 at 15:57 +0200, Arnaud Quette wrote:
> 2007/7/5, Richard Hughes <hughsient at gmail.com>:
> > On Thu, 2007-07-05 at 15:40 +0200, Arnaud Quette wrote:
> > > Hi Richard,
> > >
> > > 2007/7/3, Richard Hughes <hughsient at gmail.com>:
> > > > Guys,
> > > >
> > > > For the OLPC battery, we can extract more properties from the battery.
> > > > Which of these make sense to expose in HAL? None is a valid answer :-)
> > > >
> > > > battery.temperature
> > > > battery.is_dead
> > > > battery.is_overheat
> > > >
> > > > Comments please,
> > >
> > > UPSes (through NUT - Network UPS Tools) also exposes these:
> > > - battery.temperature => battery.temperature
> > > - battery.is_dead => ups.status contains RB (Replace Battery)
> 
> I should have added a header:
> HAL name | NUT name (and value)

Ahh, understood, sorry.

> > this should be part of the battery.* namespace - it's to do with the
> > cell, not the UPS hardware, right?
> 
> right, but the fact is that the NUT ups.status var is the only
> mandatory one, and the minimum required for client applications to be
> monitored. So the central point...
> 
> > Also, having string values with attributes is a bad thing as it forces
> > userspace to parse the data. It's better imo to expose boolean values
> > that can be trivially parsed.
> 
> as for the other NUT to HAL mapping, the conversion will obviously be
> done by NUT addons.
> so, having "ups.status=... RB ..." in NUT will be translated to
> "battery.is_dead=true" in HAL (false  otherwise).

Cool, so we agree the key might be useful. I'll add it to the spec and
then you can use it too.

> > > - battery.is_overheat => nothing standardized
> > >
> > > NUT also exposes various other temperature (depending upon the exact device):
> > > - ups.temperature
> >
> > I think we need a capability termperature_sensor now.
> 
> right.

We've had discussions about temperature sensors in the past - I think it
might be as simple as just adding a capability temperature_sensor and
the keys temperature_sensor.unit and temperature_sensor.value.

> btw, have you finally tested NUT 2.2.0 and its HAL addons with your MGE unit?

I'll be in Birmingham for at least the next week, so I can't test the
released version just yet. SVN head from a few weeks ago seemed to work
well if that helps.

Richard.




More information about the hal mailing list