psusensor: Add support for ina219
Added support for ina219 type sensors.
Also fixed issue if there is no label exposed by driver then
sensors will have default label. Added default label in table.
Tested output with ina219 sensors.
Change-Id: Ic100e5d82ec0b07356c1f25e6a952861a598149b
Signed-off-by: Vijay Khemka <vijaykhemka@fb.com>
diff --git a/src/PSUSensorMain.cpp b/src/PSUSensorMain.cpp
index cabe06a..99f6701 100644
--- a/src/PSUSensorMain.cpp
+++ b/src/PSUSensorMain.cpp
@@ -30,7 +30,7 @@
static constexpr std::array<const char*, 1> sensorTypes = {
"xyz.openbmc_project.Configuration.pmbus"};
-static std::vector<std::string> pmbusNames = {"pmbus", "pxe1610"};
+static std::vector<std::string> pmbusNames = {"pmbus", "pxe1610", "ina219"};
namespace fs = std::filesystem;
static boost::container::flat_map<std::string, std::unique_ptr<PSUSensor>>
@@ -453,14 +453,17 @@
{"pout1", PSUProperty("Output Power", 3000, 0, 6)},
{"pout2", PSUProperty("Output Power", 3000, 0, 6)},
{"pout3", PSUProperty("Output Power", 3000, 0, 6)},
+ {"power1", PSUProperty("Output Power", 3000, 0, 6)},
{"vin", PSUProperty("Input Voltage", 300, 0, 3)},
{"vout1", PSUProperty("Output Voltage", 255, 0, 3)},
{"vout2", PSUProperty("Output Voltage", 255, 0, 3)},
{"vout3", PSUProperty("Output Voltage", 255, 0, 3)},
+ {"in1", PSUProperty("Output Voltage", 255, 0, 3)},
{"iin", PSUProperty("Input Current", 20, 0, 3)},
{"iout1", PSUProperty("Output Current", 255, 0, 3)},
{"iout2", PSUProperty("Output Current", 255, 0, 3)},
{"iout3", PSUProperty("Output Current", 255, 0, 3)},
+ {"curr1", PSUProperty("Output Current", 255, 0, 3)},
{"temp1", PSUProperty("Temperature", 127, -128, 3)},
{"temp2", PSUProperty("Temperature", 127, -128, 3)},
{"temp3", PSUProperty("Temperature", 127, -128, 3)},