modified: temp-humid-read-loop.py
modified: temp-humid-read-single.py modified: temphumid.conf modified: updateMysql.py
This commit is contained in:
Regular → Executable
+4
-2
@@ -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":
|
||||
|
||||
Reference in New Issue
Block a user