The missing rain key was checked but sometimes we get the rain but only the 1h interval.
data['winddegrees'] = w['wind']['deg'] if 'deg' in w['wind'] else math.nan
data['winddirection'] = degToCompass(data['winddegrees'])
data['winddegrees'] = w['wind']['deg'] if 'deg' in w['wind'] else math.nan
data['winddirection'] = degToCompass(data['winddegrees'])
- data['precipitation'] = w['rain']['3h'] if 'rain' in w else math.nan
+ data['precipitation'] = w['rain']['3h'] if 'rain' in w and w['rain'].get('3h') else math.nan
data['visibility'] = w.get('visibility', math.nan)
return data
data['visibility'] = w.get('visibility', math.nan)
return data