Skip to content

Commit 63c5201

Browse files
committed
OpenSky: add OSH_BASE_URL override, uid on datastream, fix display URL
1 parent 1cda1d5 commit 63c5201

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

publishers/opensky/bootstrap_opensky.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@ def _datastream_schema() -> dict:
421421
"""SWE DataRecord schema for ADS-B state vector datastream."""
422422
return {
423423
"outputName": DS_OUTPUT_NAME,
424+
"uid": "urn:os4csapi:datastream:opensky-feed:adsbState:v1",
424425
"name": "Aircraft State Vectors",
425426
"description": (
426427
"Normalized OpenSky aircraft state vectors. Each observation represents one aircraft "

publishers/opensky/opensky_publisher.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,10 @@ def __init__(self):
212212

213213
# REST config
214214
import base64
215-
self._base_url = f"https://{self.osh_address}/{self.osh_root}/api"
215+
self._base_url = os.environ.get(
216+
"OSH_BASE_URL",
217+
f"https://{self.osh_address}/{self.osh_root}/api",
218+
)
216219
self._auth = "Basic " + base64.b64encode(
217220
f"{self.osh_user}:{self.osh_pass}".encode()).decode()
218221

@@ -359,7 +362,7 @@ def run(self, *, interval: float = 300.0, dry_run: bool = False, once: bool = Fa
359362
print("=" * 70)
360363
print(f" {self.name}")
361364
print("=" * 70)
362-
print(f" Server: https://{self.osh_address}:{self.osh_port}/{self.osh_root}/api")
365+
print(f" Server: {self._base_url}")
363366
print(f" Bbox: lat {bbox['lamin']}{bbox['lamax']}, lon {bbox['lomin']}{bbox['lomax']}")
364367
print(f" Interval: {interval}s")
365368
print(f" Dry run: {dry_run}")

0 commit comments

Comments
 (0)