common: use state interface object path from pdi
The base path is already available in the generated code, use that.
Change-Id: Ic9de8251a0d1f46890743c4b3390b51c6473a6a2
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
diff --git a/common/src/host_power.cpp b/common/src/host_power.cpp
index d6a78a1..f76affb 100644
--- a/common/src/host_power.cpp
+++ b/common/src/host_power.cpp
@@ -27,7 +27,10 @@
namespace phosphor::software::host_power
{
-constexpr const char* host0ObjectPath = "/xyz/openbmc_project/state/host0";
+const auto host0ObjectPath = sdbusplus::client::xyz::openbmc_project::state::
+ Host<>::namespace_path::value +
+ std::string("/host0");
+
constexpr const char* service = "xyz.openbmc_project.State.Host";
HostPower::HostPower(sdbusplus::async::context& ctx) :