add CORS
This commit is contained in:
8
run.py
8
run.py
@@ -483,18 +483,20 @@ def get_sensors():
|
||||
val = val[0]
|
||||
if val == 1 and sensors[idx] >= 0: # skip negative values
|
||||
sensors[idx] += 1
|
||||
else:
|
||||
elif val == 0:
|
||||
if sensors[idx] >= 4:
|
||||
sensors[idx] -= 4
|
||||
else:
|
||||
sensors[idx] += 4
|
||||
else:
|
||||
out = [0, 0, 0, 0]
|
||||
sensors = [0, 0, 0, 0]
|
||||
|
||||
#fprint("Values: " + str(sensors))
|
||||
#mbconn.close()
|
||||
for x in range(len(sensors)):
|
||||
if sensors[x] >= 180: # 3 sec
|
||||
# cable newly detected on tray
|
||||
sensors[x] = -10000
|
||||
sensors[x] = -180
|
||||
fprint("Precense detected: slot " + str(x))
|
||||
return x
|
||||
|
||||
|
||||
Reference in New Issue
Block a user