modified: temp-humid-read-loop.py

modified:   temp-humid-read-single.py
	modified:   temphumid.conf
	modified:   updateMysql.py
This commit is contained in:
Jonny Ervine
2015-06-19 14:30:10 +08:00
parent 16bca797d2
commit 3c4b73a171
4 changed files with 30 additions and 7 deletions
+4 -2
View File
@@ -56,7 +56,7 @@ def sensorRead(hwtype, pin, retries, timeout, maxtemp, mintemp, maxhumid, minhum
logging.debug('Current humidity close enough to previous humidity and previous humidity is not NULL, it is: %s', oldhumid)
if (t < maxtemp) and (t > mintemp) and (h < maxhumid) and (h > minhumid):
logging.debug('Temperature is less than {0} and greater than {1}, humidity is less than {2} and greater than {3}'.format(maxtemp,mintemp,maxhumid,minhumid))
updateMysql.main(t, h, host, db, username, password, logging)
updateMysql.main(t, h, host, db, username, password, logging, sql_retries, sql_timeout)
oldtemp=t
oldhumid=h
break
@@ -75,7 +75,7 @@ DHT22 = 22
AM2302 = 22
config = ConfigParser.ConfigParser()
config.read('temphumid.conf')
config.read('/etc/thMonitor.conf')
hwtype=config.get('hardware', 'DHT')
pin=config.get('hardware', 'PIN')
retries=int(config.get('software', 'retries'))
@@ -93,6 +93,8 @@ host=(config.get('database', 'host'))
db=(config.get('database', 'db'))
username=(config.get('database', 'username'))
password=(config.get('database', 'password'))
sql_retries=int((config.get('database', 'sql_retries')))
sql_timeout=(config.get('database', 'sql_timeout'))
if loglevel == "debug":