diff --git a/drone_simulator.py b/drone_simulator.py index 349eabb..601c11f 100644 --- a/drone_simulator.py +++ b/drone_simulator.py @@ -200,6 +200,7 @@ class SwedishDroneSimulator: """Send drone detection to the API""" try: payload = { + "type": "detection", # Add type field for detection "device_id": detection.device_id, "geo_lat": detection.geo_lat, "geo_lon": detection.geo_lon, @@ -211,7 +212,7 @@ class SwedishDroneSimulator: } response = requests.post( - f"{self.api_base_url}/detections", + f"{self.api_base_url}/detectors", json=payload, headers={"Content-Type": "application/json"}, timeout=10 @@ -257,7 +258,7 @@ class SwedishDroneSimulator: } response = requests.post( - f"{self.api_base_url}/heartbeat", + f"{self.api_base_url}/detectors", json=payload, headers={"Content-Type": "application/json"}, timeout=10