mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-06-24 05:35:10 +00:00
Merge branch 'main' into 95-send-spots-to-xota
# Conflicts: # README.md # webassets/apidocs/openapi.yml
This commit is contained in:
@@ -19,7 +19,12 @@ class GMA(HTTPSpotProvider):
|
||||
REF_INFO_URL_ROOT = "https://www.cqgma.org/api/ref/?"
|
||||
|
||||
def __init__(self, provider_config):
|
||||
super().__init__(provider_config, self.SPOTS_URL, self.POLL_INTERVAL_SEC)
|
||||
# Ensure there is an API key in our config, and set up the query URL using it
|
||||
self.api_key = provider_config.get("api-key", "")
|
||||
if self.api_key != "":
|
||||
super().__init__(provider_config, self.SPOTS_URL + "?key=" + self.api_key, self.POLL_INTERVAL_SEC)
|
||||
else:
|
||||
logging.warning("GMA spot provider configured but no api key was provided, this API will not be queried.")
|
||||
|
||||
def _http_response_to_spots(self, http_response):
|
||||
new_spots = []
|
||||
@@ -90,7 +95,7 @@ class GMA(HTTPSpotProvider):
|
||||
logging.warning("Exception when looking up " + self.REF_INFO_URL_ROOT + source_spot[
|
||||
"REF"] + ", ignoring this spot for now")
|
||||
else:
|
||||
logging.warning("The GMA API returned an unexpected response.")
|
||||
logging.warning(f"The GMA API returned an unexpected response (HTTP {http_response.status_code}).")
|
||||
|
||||
return new_spots
|
||||
|
||||
|
||||
Reference in New Issue
Block a user