git-svn-id: http://moon:8086/svn/projects/HendiControl@46 fda53097-d464-4ada-af97-ba876c37ca34
32 lines
588 B
Python
32 lines
588 B
Python
#!/usr/bin/python3
|
|
|
|
import time
|
|
import json
|
|
import configparser
|
|
|
|
def getValue(s):
|
|
|
|
v = s.split(' ')[0]
|
|
|
|
return v
|
|
|
|
def getUnit(s):
|
|
|
|
u = s.split(' ')[1]
|
|
|
|
return u
|
|
|
|
if __name__ == '__main__':
|
|
config = configparser.RawConfigParser()
|
|
config.read('brewpi.cfg')
|
|
print (getValue(config.get('Global', 'samplerate')))
|
|
print (getValue(config.get('Controller', 'cont_ctrl')))
|
|
print (getValue(config.get('Controller', 'heatrate')))
|
|
|
|
fp = open("brewpi.cfg.json")
|
|
configJson = json.load(fp)
|
|
print (json.dumps({'config' : configJson}, indent=4, sort_keys=True))
|
|
|
|
print ("End of program.")
|
|
|