mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
publish last heard stations to explorer
This commit is contained in:
parent
a9139d035c
commit
f5a30e33e3
|
@ -43,7 +43,14 @@ class explorer():
|
|||
log.info("[EXPLORER] publish", frequency=frequency, band=band, callsign=callsign, gridsquare=gridsquare, version=version, bandwidth=bandwidth)
|
||||
|
||||
headers = {"Content-Type": "application/json"}
|
||||
station_data = {'callsign': callsign, 'gridsquare': gridsquare, 'frequency': frequency, 'band': band, 'version': version, 'bandwidth': bandwidth, 'beacon': beacon}
|
||||
station_data = {'callsign': callsign, 'gridsquare': gridsquare, 'frequency': frequency, 'band': band, 'version': version, 'bandwidth': bandwidth, 'beacon': beacon, "lastheard": []}
|
||||
|
||||
for i in static.HEARD_STATIONS:
|
||||
callsign = str(i[0], "UTF-8")
|
||||
grid = str(i[1], "UTF-8")
|
||||
snr = i[4].split("/")[1]
|
||||
station_data["lastheard"].append({"callsign": callsign, "grid": grid, "snr": snr})
|
||||
|
||||
station_data = json.dumps(station_data)
|
||||
try:
|
||||
response = requests.post(self.explorer_url, json=station_data, headers=headers)
|
||||
|
|
Loading…
Reference in a new issue