LapStore commited on
Commit
9986845
·
1 Parent(s): f1f3204

modified api resonse

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -54,7 +54,9 @@ async def receive_coordinates(payload: CoordinatesPayload,background_tasks: Back
54
  for tl_id in tl_ids:
55
  #background_tasks.add_task(open_signal, tl_id, state_, duration,delay) #"EMR" # "ACC"
56
  answer = await open_signal(tl_id, state_, duration,delay)
 
57
  return {"answer": answer} # temp here
58
  else:
59
- return {"error": "No traffic signals found in database"+str(traffic_lights)}
 
60
 
 
54
  for tl_id in tl_ids:
55
  #background_tasks.add_task(open_signal, tl_id, state_, duration,delay) #"EMR" # "ACC"
56
  answer = await open_signal(tl_id, state_, duration,delay)
57
+ print(f"Signal {tl_id} opened with state {state_}, duration {duration}, delay {delay} ,answer: {answer}")
58
  return {"answer": answer} # temp here
59
  else:
60
+ print(f"Signal {tl_id} opened with state {state_}, duration {duration}, delay {delay} ,answer: Not found")
61
+ return {"answer": "No traffic signals found in database"+str(traffic_lights)}
62