Ratan Gupta | 0065905 | 2017-02-23 17:29:08 +0530 | [diff] [blame] | 1 | ## 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 a GENERATED Code..Please do NOT Edit !!! |
| 5 | |
| 6 | #include "types.hpp" |
| 7 | using namespace ipmi::sensor; |
| 8 | |
| 9 | extern const IdInfoMap sensors = { |
| 10 | % for key in sensorDict.iterkeys(): |
| 11 | % if key: |
| 12 | {${key},{ |
| 13 | <% |
| 14 | sensor = sensorDict[key] |
| 15 | interfaces = sensor["interfaces"] |
| 16 | path = sensor["path"] |
| 17 | sensorType = sensor["sensorType"] |
| 18 | readingType = sensor["sensorReadingType"] |
| 19 | %> |
| 20 | ${sensorType},"${path}",${readingType},{ |
| 21 | % for interface,properties in interfaces.iteritems(): |
| 22 | {"${interface}",{ |
| 23 | % for dbus_property,property_value in properties.iteritems(): |
| 24 | {"${dbus_property}",{ |
| 25 | % for offset,values in property_value.iteritems(): |
| 26 | { ${offset},{ |
Ratan Gupta | ca4c446 | 2017-03-16 00:00:06 +0530 | [diff] [blame] | 27 | <% valueType = values["type"] %>\ |
Ratan Gupta | 0065905 | 2017-02-23 17:29:08 +0530 | [diff] [blame] | 28 | % for name,value in values.iteritems(): |
| 29 | % if name == "type": |
Ratan Gupta | ca4c446 | 2017-03-16 00:00:06 +0530 | [diff] [blame] | 30 | <% continue %>\ |
Ratan Gupta | 0065905 | 2017-02-23 17:29:08 +0530 | [diff] [blame] | 31 | % endif |
| 32 | % if valueType == "string": |
| 33 | std::string("${value}"), |
Ratan Gupta | ca4c446 | 2017-03-16 00:00:06 +0530 | [diff] [blame] | 34 | % elif valueType == "bool": |
| 35 | <% value = str(value).lower() %>\ |
| 36 | ${value}, |
Ratan Gupta | 0065905 | 2017-02-23 17:29:08 +0530 | [diff] [blame] | 37 | % else: |
| 38 | ${value}, |
| 39 | % endif |
| 40 | % endfor |
| 41 | } |
| 42 | }, |
| 43 | % endfor |
| 44 | }}, |
| 45 | % endfor |
| 46 | }}, |
| 47 | % endfor |
| 48 | } |
| 49 | }}, |
| 50 | % endif |
| 51 | % endfor |
| 52 | }; |
| 53 | |