Skip to content

Commit b22086f

Browse files
author
Emily Price
authored
Merge pull request #201 from EJEP/fix_twice_daily_option
Fix request url for twice-daily forecast
2 parents 0cb579a + d1affa8 commit b22086f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
44

55
## [Unreleased]
66

7+
+ Fix bug in API request when twice-daily forecast was used.
8+
79
## [0.12.0] - 2024-11-27
810

911
+ Use one timestep per day for daily forecasts.

src/datapoint/Manager.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,11 @@ def __call_api(self, latitude, longitude, frequency):
178178
"accept": "application/json",
179179
"apikey": self.api_key,
180180
}
181-
request_url = API_URL + frequency
181+
182+
if frequency == "twice-daily":
183+
request_url = API_URL + "daily"
184+
else:
185+
request_url = API_URL + frequency
182186

183187
# Add a timeout to the request.
184188
# The value of 1 second is based on attempting 100 connections to

0 commit comments

Comments
 (0)