Skip to content

Commit

Permalink
Improve logging
Browse files Browse the repository at this point in the history
  • Loading branch information
jdejaegh committed Dec 27, 2023
1 parent 1ad42f5 commit 2644ba3
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions custom_components/irm_kmi/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,12 @@ def _api_key(method_name: str):
class IrmKmiApiClient:
"""Sample API Client."""
COORD_DECIMALS = 6

def __init__(self, session: aiohttp.ClientSession) -> None:
"""Sample API Client."""
self._session = session
self._base_url = "https://app.meteo.be/services/appv4/"

async def get_forecasts_city(self, city_id: int) -> any:
"""Get forecasts for given city."""
return await self._api_wrapper(
params={"ins": city_id,
"s": "getForecasts"}
)

async def get_forecasts_coord(self, coord: dict) -> any:
"""Get forecasts for given city."""
assert 'lat' in coord
Expand Down Expand Up @@ -99,5 +93,5 @@ async def _api_wrapper(
) from exception
except Exception as exception: # pylint: disable=broad-except
raise IrmKmiApiError(
"Something really wrong happened!"
f"Something really wrong happened! {exception}"
) from exception

0 comments on commit 2644ba3

Please sign in to comment.