mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2025-04-19 08:55:15 +00:00
Fix BrightSky date format. (#393)
BrightSky needs date format with 4 digits year and 2 digits month and day. Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
This commit is contained in:
parent
89cd9ca11d
commit
df2e3f7864
@ -96,8 +96,8 @@ class WeatherBrightSky(WeatherProvider):
|
|||||||
ValueError: If the API response does not include expected `weather` data.
|
ValueError: If the API response does not include expected `weather` data.
|
||||||
"""
|
"""
|
||||||
source = "https://api.brightsky.dev"
|
source = "https://api.brightsky.dev"
|
||||||
date = to_datetime(self.start_datetime, as_string="Y-M-D")
|
date = to_datetime(self.start_datetime, as_string="YYYY-MM-DD")
|
||||||
last_date = to_datetime(self.end_datetime, as_string="Y-M-D")
|
last_date = to_datetime(self.end_datetime, as_string="YYYY-MM-DD")
|
||||||
response = requests.get(
|
response = requests.get(
|
||||||
f"{source}/weather?lat={self.config.latitude}&lon={self.config.longitude}&date={date}&last_date={last_date}&tz={self.config.timezone}"
|
f"{source}/weather?lat={self.config.latitude}&lon={self.config.longitude}&date={date}&last_date={last_date}&tz={self.config.timezone}"
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user