diff --git a/neon_api_proxy/services/owm_api.py b/neon_api_proxy/services/owm_api.py index d13603f..1da4b53 100644 --- a/neon_api_proxy/services/owm_api.py +++ b/neon_api_proxy/services/owm_api.py @@ -32,7 +32,7 @@ from requests import Response from neon_api_proxy.cached_api import CachedAPI -from ovos_utils.log import LOG +from ovos_utils.log import LOG, log_deprecation from neon_utils.authentication_utils import find_neon_owm_key @@ -81,8 +81,10 @@ def handle_query(self, **kwargs) -> dict: def _get_api_response(self, lat: str, lng: str, units: str, api: str = "onecall", lang: str = "en") -> Response: - str(float(lat)) - str(float(lng)) + if api != "onecall": + log_deprecation(f"{api} was requested but only `onecall` " + f"is supported", "1.0.0") + api = "onecall" assert units in ("metric", "imperial", "standard") query_params = {"lat": lat, "lon": lng, @@ -90,7 +92,7 @@ def _get_api_response(self, lat: str, lng: str, units: str, "units": units, "lang": lang} query_str = urllib.parse.urlencode(query_params) - base_url = "http://api.openweathermap.org/data/2.5" + base_url = "http://api.openweathermap.org/data/3.0" resp = self.get_with_cache_timeout(f"{base_url}/{api}?{query_str}", self.cache_timeout) return resp diff --git a/neon_api_proxy/services/wolfram_api.py b/neon_api_proxy/services/wolfram_api.py index 39250d3..175c536 100644 --- a/neon_api_proxy/services/wolfram_api.py +++ b/neon_api_proxy/services/wolfram_api.py @@ -92,7 +92,7 @@ def _build_query_string(**kwargs) -> str: query_params = dict() query_params['i'] = kwargs.get("query") query_params['units'] = kwargs.get("units") if \ - kwargs.get("units") == "metric" else "nonmetric" + kwargs.get("units") == "metric" else "imperial" lat = kwargs.get("lat") lng = kwargs.get("lng") if kwargs.get("latlong"): @@ -156,6 +156,7 @@ def _query_api(self, query: str) -> dict: :return: dict response containing: `status_code`, `content`, and `encoding` """ + LOG.debug(f"query={query}") result = self.get_with_cache_timeout(query, timeout=self.cache_time) if not result.ok: # 501 = Wolfram couldn't understand