blob: 6f81e8250aa02addfb19fd981af32659fec56dc8 [file] [log] [blame]
Patrick Venturee6206562018-03-08 15:36:53 -08001## This file is a template. The comment below is emitted
2## into the rendered file; feel free to edit this file.
3
4// !!! WARNING: This is GENERATED Code... Please do NOT edit !!!
5
6#include <map>
7#include "conf.hpp"
8
Patrick Venturef3252312018-10-30 08:42:53 -07009std::map<std::string, struct SensorConfig> SensorConfig = {
Patrick Venturee6206562018-03-08 15:36:53 -080010% for key in sensorDict.iterkeys():
11 % if key:
12 <%
13 sensor = sensorDict[key]
14 type = sensor["type"]
15 readpath = sensor["readpath"]
16 writepath = sensor.get("writepath", "")
17 min = sensor.get("min", 0)
18 max = sensor.get("max", 0)
19 # Presently only thermal inputs have their timeout
20 # checked, but we should default it as 2s, which is
21 # the previously hard-coded value.
22 # If it's a fan sensor though, let's set the default
23 # to 0.
24 if type == "fan":
25 timeout = sensor.get("timeout", 0)
26 else:
27 timeout = sensor.get("timeout", 2)
28 %>
29 {"${key}",
30 {"${type}","${readpath}","${writepath}", ${min}, ${max}, ${timeout}},
31 },
32 % endif
33% endfor
34};
35
36