Closed joshsamara closed 2 years ago
Yeah, I'm seeing the same thing. The JSON data for the sunrise
and sunset
parameters are coming back from Weatherbit in the format %H:%M
which isn't being handled by the parsing code and is failing out.
Here's a sample of the JSON data:
{
"data":[
{
"wind_cdir":"WNW",
"rh":93,
"pod":"n",
"lon":-81.8418,
"pres":980.3,
"timezone":"America\/New_York",
"ob_time":"2018-08-08 02:28",
"country_code":"US",
"clouds":25,
"vis":10,
"state_code":"OH",
"wind_spd":3.09,
"lat":41.23811,
"wind_cdir_full":"west-northwest",
"slp":1013.7,
"datetime":"2018-08-08:02",
"ts":1533695280,
"station":"E2886",
"h_angle":-90,
"dewpt":21,
"uv":0,
"dni":0,
"wind_dir":290,
"elev_angle":-14.3819,
"ghi":0,
"dhi":0,
"precip":null,
"city_name":"Brunswick",
"weather":{
"icon":"c01n",
"code":"800",
"description":"Clear sky"
},
"sunset":"00:35",
"temp":22.2,
"sunrise":"10:29",
"app_temp":23
}
],
"count":1
}
Looking at the code, the only time the "%H:%M:%S"
format is being invoked is for the sunrise/sunset. I think that date_format
string can be changed to just be "%H:%M"
and it would resolve this issue.
Overview
Hi -- I'm running into an issue when using the
get_current
function.Looks like when called it's always raising a
Value Error
because it's expecting some time data from a point to be formatted differently than it is.I'm not sure if this is an issue with the lib, the data being returned from the api, or my setup.
Example Reproduction
I've tried a few other cities like "New York" and "Seattle" with the same issue.
Looks like this error isn't getting hit when using other functions like
get_forecast
.Specifications