Fix threshold updating
The object type was never stored so it was never
updated. Also change threshold size to count of
thresholds for if anything has multiple thresholds.
Tested-by: set thresholds for front panel temp
Change-Id: I0949261b87336eb4a85cf596805c02683fb30d9b
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/include/sensor.hpp b/include/sensor.hpp
index de790c8..bba2c4d 100644
--- a/include/sensor.hpp
+++ b/include/sensor.hpp
@@ -11,8 +11,9 @@
const std::string& configurationPath, const std::string& objectType,
const double max, const double min) :
name(name),
- path(path), thresholds(std::move(thresholdData)),
- configurationPath(configurationPath), maxValue(max), minValue(min)
+ path(path), configurationPath(configurationPath),
+ objectType(objectType), thresholds(std::move(thresholdData)),
+ maxValue(max), minValue(min)
{
}
virtual ~Sensor() = default;
@@ -105,7 +106,8 @@
oldValue = request; // todo, just let the config do this?
threshold.value = request;
thresholds::persistThreshold(configurationPath, objectType,
- threshold, conn);
+ threshold, conn,
+ thresholds.size());
return 1;
});
iface->register_property(alarm, false);