code beautifying

This commit is contained in:
Wolfgang Hottgenroth
2018-01-30 16:44:38 +01:00
parent 10f155caa3
commit bcb7d511a7
5 changed files with 94 additions and 58 deletions

View File

@ -13,17 +13,20 @@ configItems = [
{"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 Topic", "key":"mqttTopic", "type":"C", "length":64, "default":"IoT/TouchSwitch/Press"},
{"label":"MQTT DebugTopic", "key":"mqttDebugTopic", "type":"C", "length":64, "default":"IoT/TouchSwitch/Debug"},
{"label":"MQTT BaselineTopic", "key":"mqttBaselineTopic", "type":"C", "length":64, "default":"IoT/TouchSwitch/Baseline"},
{"label":"DebugMode", "key":"debugMode", "type":"I", "default":0},
{"label":"Period", "key":"period", "type":"I", "default":500},
{"label":"CalibrationTimeout", "key":"calibrationTimeout", "type":"I", "default":20000},
{"label":"Threshold", "key":"threshold", "type":"I", "default":10}
]
h_file = Template(file="configuration_h.tmpl", searchList=[{"configItems":configItems}])
magic = 0xC0DE0002
h_file = Template(file="configuration_h.tmpl", searchList=[{"magic":magic, "configItems":configItems}])
open('configuration.h','w').write(str(h_file))
c_file = Template(file="configuration_c.tmpl", searchList=[{"configItems":configItems}])
c_file = Template(file="configuration_c.tmpl", searchList=[{"magic":magic, "configItems":configItems}])
open('configuration.cpp','w').write(str(c_file))