summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-09-26 00:43:44 +0200
committerAki <please@ignore.pl>2022-09-26 00:43:44 +0200
commit1480fc9a3d13340cf40319ab1d630aa44423404d (patch)
treecd2e77c19ed685eea73208e77c59e05ff7feb8b6
parent78086bf15a335a9c40b5a58c2e563c0159870ed3 (diff)
downloadwindy-1480fc9a3d13340cf40319ab1d630aa44423404d.zip
windy-1480fc9a3d13340cf40319ab1d630aa44423404d.tar.gz
windy-1480fc9a3d13340cf40319ab1d630aa44423404d.tar.bz2
Merged Config into Request
-rw-r--r--windy/point_forecast.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/windy/point_forecast.py b/windy/point_forecast.py
index 2d5cab6..2ebb67f 100644
--- a/windy/point_forecast.py
+++ b/windy/point_forecast.py
@@ -38,19 +38,15 @@ class Level(_StrEnum):
@dataclass
-class Config:
- key: str
- api: str = "https://api.windy.com/api"
-
-
-@dataclass
class Request:
+ key: str
lat: float
lon: float
model: Model
parameters: list = None
levels: list = None
endpoint: str = "/point-forecast/v2"
+ api: str = "https://api.windy.com/api"
def json(self):
body = {
@@ -64,5 +60,5 @@ class Request:
return body
-def point_forecast(request: Request, config: Config):
- return requests.post(config.api + request.endpoint, json=request.json())
+def point_forecast(request: Request):
+ return requests.post(request.api + request.endpoint, json=request.json())