Skip to content

Commit

Permalink
add optional timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
freekode committed Apr 28, 2024
1 parent db274dd commit 75c5615
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pyopenweathermap"
version = "0.0.5"
version = "0.0.6"
description = "lib for OpenWeatherMap for Home Assistant"
authors = ["Evgeny <[email protected]>"]
license = "MIT"
Expand Down
5 changes: 3 additions & 2 deletions src/pyopenweathermap/owm_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@

class OWMClient:
session: ClientSession | None = None
request_timeout: int = 10
request_timeout: int

def __init__(self, api_key, units="metric", lang='en'):
def __init__(self, api_key, units="metric", lang='en', request_timeout=20):
self.api_key = api_key
self.units = units
self.lang = lang
self.request_timeout = request_timeout

async def get_weather(self, lat, lon, weather_types=None) -> WeatherReport:
if weather_types is None:
Expand Down

0 comments on commit 75c5615

Please sign in to comment.