Skip to content

Commit

Permalink
Visiblity is optional
Browse files Browse the repository at this point in the history
  • Loading branch information
freekode committed Jun 23, 2024
1 parent b180f07 commit 86fac40
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pyopenweathermap/data_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def onecall_to_current_weather(json):
dew_point=json['dew_point'],
uv_index=json['uvi'],
cloud_coverage=json['clouds'],
visibility=json['visibility'],
visibility=json.get('visibility', None),
wind_speed=json['wind_speed'],
wind_gust=json.get('wind_gust'),
wind_bearing=json['wind_deg'],
Expand Down Expand Up @@ -77,7 +77,7 @@ def freemium_to_current_weather(json):
dew_point=None,
uv_index=None,
cloud_coverage=json['clouds'],
visibility=json['visibility'],
visibility=json.get('visibility', None),
wind_speed=json['wind']['speed'],
wind_gust=json['wind'].get('gust'),
wind_bearing=json['wind']['deg'],
Expand Down

0 comments on commit 86fac40

Please sign in to comment.