Fix jwt-token
This commit is contained in:
@@ -200,6 +200,7 @@ class SwedishDroneSimulator:
|
|||||||
"""Send drone detection to the API"""
|
"""Send drone detection to the API"""
|
||||||
try:
|
try:
|
||||||
payload = {
|
payload = {
|
||||||
|
"type": "detection", # Add type field for detection
|
||||||
"device_id": detection.device_id,
|
"device_id": detection.device_id,
|
||||||
"geo_lat": detection.geo_lat,
|
"geo_lat": detection.geo_lat,
|
||||||
"geo_lon": detection.geo_lon,
|
"geo_lon": detection.geo_lon,
|
||||||
@@ -211,7 +212,7 @@ class SwedishDroneSimulator:
|
|||||||
}
|
}
|
||||||
|
|
||||||
response = requests.post(
|
response = requests.post(
|
||||||
f"{self.api_base_url}/detections",
|
f"{self.api_base_url}/detectors",
|
||||||
json=payload,
|
json=payload,
|
||||||
headers={"Content-Type": "application/json"},
|
headers={"Content-Type": "application/json"},
|
||||||
timeout=10
|
timeout=10
|
||||||
@@ -257,7 +258,7 @@ class SwedishDroneSimulator:
|
|||||||
}
|
}
|
||||||
|
|
||||||
response = requests.post(
|
response = requests.post(
|
||||||
f"{self.api_base_url}/heartbeat",
|
f"{self.api_base_url}/detectors",
|
||||||
json=payload,
|
json=payload,
|
||||||
headers={"Content-Type": "application/json"},
|
headers={"Content-Type": "application/json"},
|
||||||
timeout=10
|
timeout=10
|
||||||
|
|||||||
Reference in New Issue
Block a user