mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-08-14 16:37:33 +00:00
Fix ZLOTA location lookup
This commit is contained in:
@@ -22,16 +22,16 @@ class ZLOTA(FileDownloadSIGRefDataProvider):
|
||||
if isinstance(data, list):
|
||||
for ref in data:
|
||||
ref_id = ref["code"]
|
||||
latitude = ref["y"]
|
||||
longitude = ref["x"]
|
||||
latitude = ref["latitude"]
|
||||
longitude = ref["longitude"]
|
||||
|
||||
ref = SIGRef(sig=self.SIG, id=ref_id, name=ref["name"],
|
||||
new_ref = SIGRef(sig=self.SIG, id=ref_id, name=ref["name"],
|
||||
url="https://ontheair.nz/assets/" + ref_id.replace("/", "_"),
|
||||
latitude=latitude,
|
||||
longitude=longitude)
|
||||
if latitude and longitude:
|
||||
ref.grid = latlong_to_locator(latitude, longitude, 6)
|
||||
new_data.append(ref)
|
||||
ref.new_ref = latlong_to_locator(latitude, longitude, 6)
|
||||
new_data.append(new_ref)
|
||||
|
||||
# Bail out if a stop has been requested, i.e. the program is shutting down - no need to parse the rest
|
||||
# of the data in this case
|
||||
|
||||
@@ -12,7 +12,6 @@ class ZLOTA(HTTPSpotProvider):
|
||||
|
||||
POLL_INTERVAL_SEC = 120
|
||||
SPOTS_URL = "https://ontheair.nz/api/spots?zlota_only=true"
|
||||
LIST_URL = "https://ontheair.nz/assets/assets.json"
|
||||
|
||||
def __init__(self, provider_config):
|
||||
super().__init__("ZLOTA", provider_config, self.SPOTS_URL, self.POLL_INTERVAL_SEC)
|
||||
|
||||
Reference in New Issue
Block a user