Fix trigger type for OnChange triggers
Triggers with no threshold parameters should be treated as ones that
activate on change of monitored metric values', with `Discrete` property
value set to true. Otherwise they will be wrongly treated as numeric
triggers on Redfish side. This patch corrects this behavior.
Tested:
1. Created simple discrete trigger: `TestTriggerDiscreteOnChange`, with
`DiscreteTriggerCondition` set to `Changed`.
2. busctl introspect xyz.openbmc_project.Telemetry
/xyz/openbmc_project/Telemetry/Triggers/TelemetryService/
TestTriggerDiscreteOnChange
3. Verified that `Discrete` property is true
All unit tests have passed.
Change-Id: I06762c94b38a9da42a64c9a014d3f6dd47577176
Signed-off-by: Michal Orzel <michalx.orzel@intel.com>
diff --git a/src/trigger.hpp b/src/trigger.hpp
index e636334..c0b2845 100644
--- a/src/trigger.hpp
+++ b/src/trigger.hpp
@@ -48,7 +48,7 @@
private:
std::vector<LabeledSensorInfo> getLabeledSensorInfo() const;
std::vector<LabeledThresholdParam> getLabeledThresholds() const;
- bool isDiscreate() const;
+ bool isDiscrete() const;
const TriggerId id;
const sdbusplus::message::object_path path;