From a09abf5cbb331a9107d997b80f1a4c6b0aebb9c5 Mon Sep 17 00:00:00 2001 From: Alexander Borg Date: Sun, 7 Sep 2025 14:29:24 +0200 Subject: [PATCH] Fix jwt-token --- drone_simulator.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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