add location
This commit is contained in:
@@ -20,6 +20,8 @@ app.include_router(create_op25_router(), prefix="/op25")
|
||||
# Configuration
|
||||
NODE_ID = os.getenv("NODE_ID", "standalone-node")
|
||||
MQTT_BROKER = os.getenv("MQTT_BROKER", None)
|
||||
NODE_LAT = os.getenv("NODE_LAT")
|
||||
NODE_LONG = os.getenv("NODE_LONG")
|
||||
|
||||
# Global flag to track MQTT connection state
|
||||
MQTT_CONNECTED = False
|
||||
@@ -155,7 +157,11 @@ async def mqtt_lifecycle_manager():
|
||||
"is_listening": op25_status.get("is_running", False),
|
||||
"active_system": op25_status.get("active_system"),
|
||||
# Only scan library if needed, otherwise it's heavy I/O
|
||||
"available_systems": scan_local_library()
|
||||
"available_systems": scan_local_library(),
|
||||
"location": {
|
||||
"lat": float(NODE_LAT) if NODE_LAT else None,
|
||||
"long": float(NODE_LONG) if NODE_LONG else None
|
||||
}
|
||||
}
|
||||
|
||||
client.publish(f"nodes/{NODE_ID}/checkin", json.dumps(payload), retain=True)
|
||||
|
||||
@@ -16,6 +16,8 @@ services:
|
||||
- .env
|
||||
environment:
|
||||
- NODE_ID=${NODE_ID}
|
||||
- NODE_LAT=${NODE_LAT}
|
||||
- NODE_LONG=${NODE_LONG}
|
||||
- MQTT_BROKER=${MQTT_BROKER}
|
||||
- ICECAST_SERVER=${ICECAST_SERVER}
|
||||
networks:
|
||||
|
||||
Reference in New Issue
Block a user