blob: 56e7965cad31fde6734d07c4a1a59a8670db5465 [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 Venturec54fbd82018-10-30 19:40:05 -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"]
Patrick Venture69c51062019-02-11 09:46:03 -080015 readPath = sensor["readPath"]
16 writePath = sensor.get("writePath", "")
Patrick Venturee6206562018-03-08 15:36:53 -080017 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}",
Patrick Venture69c51062019-02-11 09:46:03 -080030 {"${type}","${readPath}","${writePath}", ${min}, ${max}, ${timeout}},
Patrick Venturee6206562018-03-08 15:36:53 -080031 },
32 % endif
33% endfor
34};
35
36