|
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') |
|
|
|
err = 1 |
|
pass |
|
else: |
|
|
|
globs.ph = 0 |
|
globs.ec = 0 |
|
globs.dey = 0 |
|
globs.wek = 0 |
|
|
|
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) |
|
|
|
|