Skip to content
Commit aa154232 authored by P.K. Lee's avatar P.K. Lee Committed by Patrick Williams
Browse files

meta-facebook: ventura: add virtual sensors to convert units



The units for sensor FCB_0_FAN_0_CURR_A, FCB_0_FAN_1_CURR_A,
FCB_1_FAN_2_CURR_A, FCB_1_FAN_3_CURR_A should be in Amperes, but since
dbus-sensors doesn't support changing units, I used
phosphor-virtual-sensor to convert the units from Volts to Amperes.

Tested:
```
sensor                          status          value           units
------------------------        --------        ----------      --------
FCB_0_FAN_0_CURR_A              ok              0.0043          Amperes
FCB_0_FAN_0_IMON_VOLT_V         ok              2               Volts
FCB_0_FAN_1_CURR_A              ok              0.0086          Amperes
FCB_0_FAN_1_IMON_VOLT_V         ok              4               Volts
FCB_1_FAN_2_CURR_A              ok              0               Amperes
FCB_1_FAN_2_IMON_VOLT_V         ok              0               Volts
FCB_1_FAN_3_CURR_A              ok              0               Amperes
FCB_1_FAN_3_IMON_VOLT_V         ok              0               Volts

root@bmc:~# busctl tree xyz.openbmc_project.VirtualSensor
`- /xyz
  `- /xyz/openbmc_project
    `- /xyz/openbmc_project/sensors
      `- /xyz/openbmc_project/sensors/current
        |- /xyz/openbmc_project/sensors/current/FCB_0_FAN_0_CURR_A
        |- /xyz/openbmc_project/sensors/current/FCB_0_FAN_1_CURR_A
        |- /xyz/openbmc_project/sensors/current/FCB_1_FAN_2_CURR_A
        `- /xyz/openbmc_project/sensors/current/FCB_1_FAN_3_CURR_A

root@bmc:~# busctl introspect xyz.openbmc_project.VirtualSensor /xyz/openbmc_project/sensors/current/FCB_0_FAN_0_CURR_A
NAME                                TYPE      SIGNATURE RESULT/VALUE                             FLAGS
org.freedesktop.DBus.Introspectable interface -         -                                        -
.Introspect                         method    -         s                                        -
org.freedesktop.DBus.Peer           interface -         -                                        -
.GetMachineId                       method    -         s                                        -
.Ping                               method    -         -                                        -
org.freedesktop.DBus.Properties     interface -         -                                        -
.Get                                method    ss        v                                        -
.GetAll                             method    s         a{sv}                                    -
.Set                                method    ssv       -                                        -
.PropertiesChanged                  signal    sa{sv}as  -                                        -
xyz.openbmc_project.Sensor.Value    interface -         -                                        -
.MaxValue                           property  d         inf                                      emits-change writable
.MinValue                           property  d         -inf                                     emits-change writable
.Unit                               property  s         "xyz.openbmc_project.Sensor.Value.Uni... emits-change writable
.Value                              property  d         0.00431034                               emits-change writabl
```

Change-Id: Ia3bbb2041c92a245f212563a2b7743c9d5f8d234
Signed-off-by: default avatarP.K. Lee <p.k.lee@quantatw.com>
parent bf4621af
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment