Skip to content

one_call_history in API 3.0 -> getting a "impossible to read weather info from input data" error #447

@omerhertz

Description

@omerhertz

When using mgr.one_call_history(lat=lat, lon=lon, dt=timestamp) with API 3.0 (i.e. in current master), an error will always be thrown.
Error:
'pyowm.weatherapi30.one_call: impossible to read weather info from input data'

Reason:
In

current = Weather.from_dict(the_dict["current"])
the code is getting the_dict["current"]. However, since the move to API 3.0, the key is "data".
It seems that this old fork solved the issue- https://github.com/KeithB/pyowm-onecall3/tree/dev
Please look at this commit to see the fix-
if 'current' in the_dict:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions