API & Client - remove DarkSky weather provider
This commit is contained in:
@@ -5,14 +5,12 @@ from gpxpy.gpx import GPXTrackPoint
|
||||
|
||||
from fittrackee import appLog
|
||||
|
||||
from .dark_sky import DarkSky
|
||||
from .visual_crossing import VisualCrossing
|
||||
|
||||
|
||||
class WeatherService:
|
||||
"""
|
||||
Available API:
|
||||
- DarkSky (deprecated, will end on March 31st, 2023)
|
||||
- VisualCrossing
|
||||
"""
|
||||
|
||||
@@ -20,7 +18,7 @@ class WeatherService:
|
||||
self.weather_api = self._get_weather_api()
|
||||
|
||||
@staticmethod
|
||||
def _get_weather_api() -> Union[DarkSky, VisualCrossing, None]:
|
||||
def _get_weather_api() -> Union[VisualCrossing, None]:
|
||||
weather_api_key: str = os.getenv('WEATHER_API_KEY', '')
|
||||
weather_api_provider: str = os.getenv(
|
||||
'WEATHER_API_PROVIDER', ''
|
||||
@@ -28,8 +26,6 @@ class WeatherService:
|
||||
|
||||
if not weather_api_key:
|
||||
return None
|
||||
if weather_api_provider == 'darksky': # deprecated
|
||||
return DarkSky(weather_api_key)
|
||||
if weather_api_provider == 'visualcrossing':
|
||||
return VisualCrossing(weather_api_key)
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user