dbus-sensors: Unit property for xyz.openbmc_project.Sensor.Value interface
Andrei Kartashev
a.kartashev at yadro.com
Thu Sep 17 04:36:31 AEST 2020
On Wed, 2020-09-16 at 09:24 -0700, Ed Tanous wrote:
> On Wed, Sep 16, 2020 at 8:23 AM James Feist <
> james.feist at linux.intel.com> wrote:
> > On 9/16/2020 6:28 AM, Andrei Kartashev wrote:
> > > Hi,
> > >
> > > We noticed that dbus-sensors doesn't fully implement
> > > xyz.openbmc_project.Sensor.Value interface: there is no Unit
> > > property
> > > for all the sensors, defined by dbus-sensors.
> > > I believe it was intentionally, but I still wondering what was
> > > the
> > > reason?
> >
> > It was originally as the information seemed redundant. If the
> > information is needed I'm fine with someone adding it, it just
> > hasn't
> > seemed to be a high priority.
>
> Considering we've gone this long with no impact (considering the path
> can be used to lookup the unit) I wonder if we should consider
> removing unit from the sensor Value API? It doesn't seem used.
>
> > > I noticed that in intel-ipmi-oem units are determined based on
> > > object
> > > paths, but that looks ugly since there is well-defined natural
> > > interface for units in dbus.
> > > Lack of the "Unit" property in the interface breaks some existing
> > > logic.
> > >
>
> Technically the way the interfaces define it, both are valid to use
> to
> determine the Units, and both would need to be lookup tables. Is
> using the path any more ugly than using the property?
I really don't like this approach to determine Units based on Path. It
is really not logical, I was surprised to find that "Objects
implementing Sensor.Value must be instantiated in the correct hierarchy
within the sensors namespace." Isn't interfaces are supposed to break
out hierarchy dependency?
Semantically consumers can only guess units, but only dbus-sensors
being data source really know units, so it would be logical that dbus-
sensors explicitly exports units.
More of then, now we have same algorithm of determining units in
different places - this is potential source of inconsistency.
I vote for implementing "Unit" property and removing calculation units
based on path everywhere.
PS: sorry if this message would duplicate, but I didn't receive back
the message I have sent hour ago.
--
Best regards,
Andrei Kartashev
More information about the openbmc
mailing list