Fix jwt-token
This commit is contained in:
@@ -252,6 +252,10 @@ class SwedishDroneSimulator:
|
|||||||
payload = {
|
payload = {
|
||||||
"type": "heartbeat",
|
"type": "heartbeat",
|
||||||
"key": str(device.device_id), # Use device ID directly as key
|
"key": str(device.device_id), # Use device ID directly as key
|
||||||
|
"device_id": device.device_id, # Also include explicit device_id
|
||||||
|
"geo_lat": device.lat, # Include device coordinates
|
||||||
|
"geo_lon": device.lon,
|
||||||
|
"location_description": device.location, # Include location name
|
||||||
"battery_level": device.battery_level,
|
"battery_level": device.battery_level,
|
||||||
"signal_strength": device.signal_strength,
|
"signal_strength": device.signal_strength,
|
||||||
"temperature": device.temperature
|
"temperature": device.temperature
|
||||||
|
|||||||
@@ -46,6 +46,9 @@ const detectorSchema = Joi.alternatives().try(
|
|||||||
key: Joi.string().required(),
|
key: Joi.string().required(),
|
||||||
// Optional heartbeat fields
|
// Optional heartbeat fields
|
||||||
device_id: Joi.number().integer().optional(),
|
device_id: Joi.number().integer().optional(),
|
||||||
|
geo_lat: Joi.number().min(-90).max(90).optional(),
|
||||||
|
geo_lon: Joi.number().min(-180).max(180).optional(),
|
||||||
|
location_description: Joi.string().optional(),
|
||||||
signal_strength: Joi.number().integer().optional(),
|
signal_strength: Joi.number().integer().optional(),
|
||||||
battery_level: Joi.number().integer().min(0).max(100).optional(),
|
battery_level: Joi.number().integer().min(0).max(100).optional(),
|
||||||
temperature: Joi.number().optional(),
|
temperature: Joi.number().optional(),
|
||||||
|
|||||||
Reference in New Issue
Block a user