|
from flask import request, jsonify |
|
import globs |
|
import os |
|
api_variable = os.getenv('api') |
|
|
|
|
|
|
|
def api(): |
|
err = 0 |
|
|
|
|
|
if api_variable == request.args.get('api'): |
|
|
|
|
|
globs.dey = request.args.get('dey') |
|
globs.wek = request.args.get('wek') |
|
globs.ph = request.args.get('ph') |
|
globs.ec = request.args.get('ec') |
|
globs.tS = request.args.get('tS') |
|
globs.tA = request.args.get('tA') |
|
globs.hDm = request.args.get('hDm') |
|
globs.sVen = request.args.get('sVen') |
|
|
|
globs.rFul = request.args.get('rFul') |
|
globs.rLi = request.args.get('rLi') |
|
globs.rWat = request.args.get('rWat') |
|
globs.rRas = request.args.get('rRas') |
|
globs.rPH = request.args.get('rPH') |
|
globs.rEC = request.args.get('rEC') |
|
globs.rSl = request.args.get('rSl') |
|
globs.rLe = request.args.get('rLe') |
|
globs.alW = request.args.get('alW') |
|
|
|
globs.ph_eep = request.args.get('ph_eep') |
|
|
|
|
|
err = 1 |
|
pass |
|
else: |
|
|
|
|
|
err = 0 |
|
pass |
|
|
|
|
|
response = { |
|
"ph_set": globs.ph, |
|
"ec_set": globs.ec, |
|
"dey_set": globs.dey, |
|
"wek_set": globs.wek, |
|
"err": err |
|
} |
|
|
|
|
|
return jsonify(response) |
|
|
|
|