summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorEmily Shaffer <emilyshaffer@google.com>2017-05-10 12:01:10 -0700
committerPatrick Williams <patrick@stwcx.xyz>2017-07-17 15:06:04 -0500
commit10f4959a020f33d40e7387d93fdab9bba46963d7 (patch)
treeeb7c0e97d7b32d11f59bfd5bf8b22de4efc0ef91 /scripts
parentbbef71c2a9aab57a826b4c7ec8f183e92eb6e28c (diff)
downloadphosphor-host-ipmid-10f4959a020f33d40e7387d93fdab9bba46963d7.tar.gz
phosphor-host-ipmid-10f4959a020f33d40e7387d93fdab9bba46963d7.zip
sensorhandler: Add functionality to use m, b, b_exp from config.yaml
Change-Id: I1b5b8a5e0e5abd74eadde494728f363cf1ca4ec6 Signed-off-by: Emily Shaffer <emilyshaffer@google.com> Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/writesensor.mako.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/writesensor.mako.cpp b/scripts/writesensor.mako.cpp
index fbfe6a9..cb3be09 100644
--- a/scripts/writesensor.mako.cpp
+++ b/scripts/writesensor.mako.cpp
@@ -16,8 +16,12 @@ extern const IdInfoMap sensors = {
path = sensor["path"]
sensorType = sensor["sensorType"]
readingType = sensor["sensorReadingType"]
+ multiplier = sensor.get("multiplierM", 1)
+ offset = sensor.get("offsetB", 0)
+ exp = sensor.get("bExp", 0)
%>
- ${sensorType},"${path}",${readingType},{
+ ${sensorType},"${path}",${readingType},${multiplier},${offset},${exp},
+ ${offset * pow(10,exp)},{
% for interface,properties in interfaces.iteritems():
{"${interface}",{
% for dbus_property,property_value in properties.iteritems():
OpenPOWER on IntegriCloud