2018-01-24 12:48:12 +01:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
|
|
|
from Cheetah.Template import Template
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
configItems = [
|
|
|
|
{"label":"_", "key":"magic", "type":"I", "default": ""},
|
|
|
|
{"label":"Wifi SSID", "key":"wifiSsid", "type":"C", "length":32, "default":"test"},
|
|
|
|
{"label":"Wifi Key", "key":"wifiKey", "type":"C", "length":64, "default":"geheim"},
|
|
|
|
{"label":"MQTT Broker", "key":"mqttBroker", "type":"C", "length":64, "default":"broker.hottis.de"},
|
2018-01-25 15:25:49 +01:00
|
|
|
{"label":"MQTT Username", "key":"mqttUser", "type":"C", "length":32, "default":"TouchSwitch"},
|
|
|
|
{"label":"MQTT Password", "key":"mqttPass", "type":"C", "length":32, "default":"geheim123"},
|
|
|
|
{"label":"MQTT ClientId", "key":"mqttClientId", "type":"C", "length":32, "default":"TouchSwitch"},
|
|
|
|
{"label":"MQTT Topic", "key":"mqttTopic", "type":"C", "length":64, "default":"IoT/TouchSwitch/Press"},
|
|
|
|
{"label":"MQTT Port", "key":"mqttPort", "type":"I", "default":8883},
|
|
|
|
{"label":"DebugMode", "key":"debugMode", "type":"I", "default":0},
|
|
|
|
{"label":"MQTT DebugTopic", "key":"mqttDebugTopic", "type":"C", "length":64, "default":"IoT/TouchSwitch/Debug"},
|
|
|
|
{"label":"Period", "key":"period", "type":"I", "default":500},
|
2018-01-30 13:26:26 +01:00
|
|
|
{"label":"CalibrationTimeout", "key":"calibrationTimeout", "type":"I", "default":20000},
|
|
|
|
{"label":"Threshold", "key":"threshold", "type":"I", "default":10}
|
2018-01-24 12:48:12 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
h_file = Template(file="configuration_h.tmpl", searchList=[{"configItems":configItems}])
|
|
|
|
open('configuration.h','w').write(str(h_file))
|
|
|
|
c_file = Template(file="configuration_c.tmpl", searchList=[{"configItems":configItems}])
|
|
|
|
open('configuration.cpp','w').write(str(c_file))
|