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