From f9b1ce97407f0077e8141cf7cd7cda1657bd1d05 Mon Sep 17 00:00:00 2001 From: Shirish Pargaonkar Date: Fri, 7 Aug 2026 16:57:12 -0500 Subject: [PATCH] Use getSubTreePaths to obtain fan objects that have interface xyz.openbmc_project.Sensor.Value using Object Mapper. These fan objects are created under service xyz.openbmc_project.FanSensor With the current version of Entity Manager, it does not have support for D-Bus interfaces "Associations" such as cooled_by and it does not support "Exposes" within "Type": "Chassis" Tested: On congo Signed-off-by: Shirish Pargaonkar --- redfish-core/lib/fan.hpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/redfish-core/lib/fan.hpp b/redfish-core/lib/fan.hpp index c10288df7e..08f3439b7e 100644 --- a/redfish-core/lib/fan.hpp +++ b/redfish-core/lib/fan.hpp @@ -36,7 +36,7 @@ namespace redfish { constexpr std::array fanInterface = { - "xyz.openbmc_project.Inventory.Item.Fan"}; + "xyz.openbmc_project.Sensor.Value"}; inline void updateFanList( const std::shared_ptr& asyncResp, @@ -65,16 +65,13 @@ inline void updateFanList( inline void getFanPaths( const std::shared_ptr& asyncResp, - const std::string& validChassisPath, + const std::string& /* validChassisPath */, const std::function& callback) { - sdbusplus::message::object_path endpointPath{validChassisPath}; - endpointPath /= "cooled_by"; - - dbus::utility::getAssociatedSubTreePaths( - endpointPath, - sdbusplus::message::object_path("/xyz/openbmc_project/inventory"), 0, + dbus::utility::getSubTreePaths( + "/xyz/openbmc_project/sensors/fan_tach", + 0, fanInterface, [asyncResp, callback]( const boost::system::error_code& ec,