Read MaxValue and MinValue from configuration
Read MaxValue and MinValue from enviroment variables file.
With this change MAXVALUE_temp1 and MINVALUE_temp1 for example
can be read from the configuration and added to dbus.
Change-Id: Ic7c2ba57ae65415bb154c617b13866d661969e5a
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/mainloop.cpp b/mainloop.cpp
index 419bfc7..1cd5db6 100644
--- a/mainloop.cpp
+++ b/mainloop.cpp
@@ -237,6 +237,17 @@
iface->scale(getScale(attrs));
}
+ auto maxValue = getEnv("MAXVALUE", sensor);
+ if(!maxValue.empty())
+ {
+ iface->maxValue(std::stoll(maxValue));
+ }
+ auto minValue = getEnv("MINVALUE", sensor);
+ if(!minValue.empty())
+ {
+ iface->minValue(std::stoll(minValue));
+ }
+
obj[InterfaceType::VALUE] = iface;
return iface;
}