Thresholds: Support all valid severity types
Add in PerformanceLoss and fix the value for SoftShutdown and
HardShutdown.
Tested: Added in to a hwmontempsensor config and thresholds appear in
busctl and alarms go high and low as expected.
Signed-off-by: Rashmica Gupta <rashmica.g@gmail.com>
Change-Id: Ic08a0e1fe171f39f8e537b60522149a9420bc62e
diff --git a/include/Thresholds.hpp b/include/Thresholds.hpp
index 42a441f..94480bb 100644
--- a/include/Thresholds.hpp
+++ b/include/Thresholds.hpp
@@ -17,6 +17,7 @@
{
WARNING,
CRITICAL,
+ PERFORMANCELOSS,
SOFTSHUTDOWN,
HARDSHUTDOWN,
ERROR
@@ -129,11 +130,12 @@
const char* levelName;
};
-constexpr static std::array<thresholds::ThresholdDefinition, 4> thresProp = {
+constexpr static std::array<thresholds::ThresholdDefinition, 5> thresProp = {
{{Level::WARNING, 0, "Warning"},
{Level::CRITICAL, 1, "Critical"},
- {Level::SOFTSHUTDOWN, 2, "SoftShutdown"},
- {Level::HARDSHUTDOWN, 3, "HardShutdown"}}};
+ {Level::PERFORMANCELOSS, 2, "PerformanceLoss"},
+ {Level::SOFTSHUTDOWN, 3, "SoftShutdown"},
+ {Level::HARDSHUTDOWN, 4, "HardShutdown"}}};
std::string getInterface(const Level level);