Update Associations For bmcweb changes
Updating according to
https://gerrit.openbmc-project.xyz/c/openbmc/docs/+/22976
Tested: Thermal had all fans, and presence worked.
Change-Id: I03e1e13b3a9c2f6d2ac4b7afc6e2723c04597931
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/src/TachSensor.cpp b/src/TachSensor.cpp
index aeef7c5..45ac7ac 100644
--- a/src/TachSensor.cpp
+++ b/src/TachSensor.cpp
@@ -71,12 +71,21 @@
if (presence)
{
itemIface =
- objectServer.add_interface("/xyz/openbmc_project/Inventory/" + name,
+ objectServer.add_interface("/xyz/openbmc_project/inventory/" + name,
"xyz.openbmc_project.Inventory.Item");
itemIface->register_property("PrettyName",
std::string()); // unused property
itemIface->register_property("Present", true);
itemIface->initialize();
+ itemAssoc =
+ objectServer.add_interface("/xyz/openbmc_project/inventory/" + name,
+ "org.openbmc.Associations");
+ itemAssoc->register_property(
+ "associations",
+ std::vector<Association>{
+ {"sensors", "inventory",
+ "/xyz/openbmc_project/sensors/fan_tach/" + name}});
+ itemAssoc->initialize();
}
setInitialProperties(conn);
setupPowerMatch(conn);
@@ -93,6 +102,7 @@
objServer.remove_interface(sensorInterface);
objServer.remove_interface(association);
objServer.remove_interface(itemIface);
+ objServer.remove_interface(itemAssoc);
}
void TachSensor::setupRead(void)