Example #1
0
def periodicdatarequest(sensorname):
    print "Read sensors request: ", sensorname, " ", datetime.now()
    logger.info('Read sensor data: %s - %s', sensorname,
                datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
    sensorvalue = hardwaremod.getsensordata(sensorname, 3)
    if sensorvalue != "":
        sensordbmod.insertdataintable(sensorname, sensorvalue)
Example #2
0
def periodicdatarequest(sensorname):
	print "Read sensors request: ", sensorname , " " , datetime.now()
	logger.info('Read sensor data: %s - %s', sensorname, datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
	sensorvalue=hardwaremod.getsensordata(sensorname,3)
	if sensorvalue!="":
		sensordbmod.insertdataintable(sensorname,sensorvalue)
		# Automation algoritm 
		automationmod.automationcheck(sensorname)
		# call to automatic algorithms for watering
		autowateringmod.autowateringcheck(sensorname)
		
	return True	
Example #3
0
def periodicdatarequest(sensorname):
	print("Read sensors request: ", sensorname , " " , datetime.now())
	logger.info('Read sensor data: %s - %s', sensorname, datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
	isok, sensorvalue, errmsg = hardwaremod.getsensordata(sensorname,3)
	if sensorvalue!="":
		sensordbmod.insertdataintable(sensorname,sensorvalue)
		# Automation algoritm 
		automationmod.automationcheck(sensorname)
		# call to automatic algorithms for watering
		autowateringmod.autowateringcheck(sensorname)
		
	return True	
Example #4
0
def savedata(sensorname, sensorvalue):
    sensorvalue_str = str(sensorvalue)
    sensorvalue_norm = hardwaremod.normalizesensordata(sensorvalue_str,
                                                       sensorname)
    sensordbmod.insertdataintable(sensorname, sensorvalue_norm)
    return
def savedata(sensorname, sensorvalue):
    sensordbmod.insertdataintable(sensorname, sensorvalue)
    return