adjust log_cpu temperature

master
ademant 2019-06-25 15:20:39 +02:00
parent 22f83aa1e4
commit 68b260fe6e
1 changed files with 7 additions and 8 deletions

View File

@ -12,15 +12,14 @@ configfile="config.json"
cf=open(configfile,"r")
log_conf=json.load(cf)
cf.close()
devicename=socket.gethostname()
if "device" in log_conf:
devicename=log_conf['device']
mean_count=5
if "mean_count" in log_conf:
mean_count=int(log_conf['mean_count'])
parameter={"device":socket.gethostname(),"mean_count":5,"ring_length":10,"wait":0.5}
for n in parameter:
if n in log_conf:
parameter[n]=log_conf[n]
cpu_meas=meas_data(var_name="temperature",ring_length=60,device=devicename,sensor="CPU",store_file="/home/pi/log/data_cpu")
cpu_meas=meas_data(var_name="temperature",ring_length=parameter['ring_length'],device=parameter['device'],sensor="CPU",store_file="/home/pi/log/data_cpu")
if "sqlserver" in log_conf:
hostname="banana"
@ -38,7 +37,7 @@ while True:
# get cpu temperature
cpu_meas.append(int(open('/sys/class/thermal/thermal_zone0/temp').read()))
time.sleep(.5)
time.sleep(parameter['wait'])
# close the client