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
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