mirror of
https://github.com/jlu5/SupyPlugins.git
synced 2025-04-27 13:31:10 -05:00
NuWeather: fix crash with DarkSky when forecast summary is unavailable
This commit is contained in:
parent
38e31daf3e
commit
fcef45ae77
@ -490,7 +490,7 @@ class NuWeather(callbacks.Plugin):
|
|||||||
'forecast': [{'dayname': self._get_dayname(forecastdata['time'], idx, tz=data['timezone']),
|
'forecast': [{'dayname': self._get_dayname(forecastdata['time'], idx, tz=data['timezone']),
|
||||||
'max': self._format_temp(f=forecastdata.get('temperatureHigh')),
|
'max': self._format_temp(f=forecastdata.get('temperatureHigh')),
|
||||||
'min': self._format_temp(f=forecastdata.get('temperatureLow')),
|
'min': self._format_temp(f=forecastdata.get('temperatureLow')),
|
||||||
'summary': forecastdata['summary'].rstrip('.')} for idx, forecastdata in enumerate(data['daily']['data'])]
|
'summary': forecastdata.get('summary', 'N/A').rstrip('.')} for idx, forecastdata in enumerate(data['daily']['data'])]
|
||||||
}
|
}
|
||||||
|
|
||||||
def _openweathermap_fetcher(self, location, geobackend=None):
|
def _openweathermap_fetcher(self, location, geobackend=None):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user