Change power control match to use host state
Lower level signals were removed, use host state instead.
Also fix bug that was introduced, std::abs(nan, number)
returns nan, so checkThresholds wasn't being called.
Tested: Put in prints and saw power/post state change to on
Change-Id: I98df270237900c3a0b01c03ec7905851bc47e3b3
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/include/Utils.hpp b/include/Utils.hpp
index f3abc7f..4f595c9 100644
--- a/include/Utils.hpp
+++ b/include/Utils.hpp
@@ -78,6 +78,23 @@
constexpr const char* get = "Get";
} // namespace properties
+namespace power
+{
+const static constexpr char* busname = "xyz.openbmc_project.State.Host";
+const static constexpr char* interface = "xyz.openbmc_project.State.Host";
+const static constexpr char* path = "/xyz/openbmc_project/state/host0";
+const static constexpr char* property = "CurrentHostState";
+} // namespace power
+namespace post
+{
+const static constexpr char* busname =
+ "xyz.openbmc_project.State.OperatingSystem";
+const static constexpr char* interface =
+ "xyz.openbmc_project.State.OperatingSystem.Status";
+const static constexpr char* path = "/xyz/openbmc_project/state/os";
+const static constexpr char* property = "OperatingSystemState";
+} // namespace post
+
template <typename T>
inline T loadVariant(
const boost::container::flat_map<std::string, BasicVariantType>& data,
@@ -103,7 +120,7 @@
}
else
{
- static_assert("Type Not Implemented");
+ static_assert(!std::is_same_v<T, T>, "Type Not Implemented");
}
}