mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2025-12-16 00:53:39 +00:00
Remove start/end dates #82
This commit is contained in:
@@ -6,24 +6,19 @@ from spotproviders.http_spot_provider import HTTPSpotProvider
|
||||
|
||||
|
||||
# Spot provider for servers based on the "xOTA" software at https://github.com/nischu/xOTA/
|
||||
# The provider typically doesn't give us a lat/lon or SIG explicitly, so our own config provides this information. Our
|
||||
# config also optionally provides a start & end date; this avoids querying the source if the xOTA event is time-limited
|
||||
# and it's not currently running. This functionality is implemented for TOTA events.
|
||||
# The provider typically doesn't give us a lat/lon or SIG explicitly, so our own config provides this information. This
|
||||
# functionality is implemented for TOTA events.
|
||||
class XOTA(HTTPSpotProvider):
|
||||
POLL_INTERVAL_SEC = 300
|
||||
FIXED_LATITUDE = None
|
||||
FIXED_LONGITUDE = None
|
||||
SIG = None
|
||||
START_DATE = None
|
||||
END_DATE = None
|
||||
|
||||
def __init__(self, provider_config):
|
||||
super().__init__(provider_config, provider_config["url"] + "/api/spot/all", self.POLL_INTERVAL_SEC)
|
||||
self.FIXED_LATITUDE = provider_config["latitude"] if "latitude" in provider_config else None
|
||||
self.FIXED_LONGITUDE = provider_config["longitude"] if "longitude" in provider_config else None
|
||||
self.SIG = provider_config["sig"] if "sig" in provider_config else None
|
||||
self.START_DATE = provider_config["start-date"] if "start-date" in provider_config else None
|
||||
self.END_DATE = provider_config["end-date"] if "end-date" in provider_config else None
|
||||
|
||||
def http_response_to_spots(self, http_response):
|
||||
new_spots = []
|
||||
|
||||
Reference in New Issue
Block a user