mirror of
https://github.com/craigerl/aprsd.git
synced 2024-11-17 22:01:49 -05:00
Fixed an issue with LocationPlugin
When calling LocationPlugin with a callsign outside of the US, the forecast.weather gov wasn't raising an exception. A valid json dict was coming back, but it didn't have location data we were expecting.
This commit is contained in:
parent
51894bbab8
commit
0d18e54969
@ -65,6 +65,10 @@ class LocationPlugin(plugin.APRSDPluginBase):
|
||||
LOG.error("Couldn't fetch forecast.weather.gov '{}'".format(ex))
|
||||
wx_data = {"location": {"areaDescription": "Unknown Location"}}
|
||||
|
||||
if "location" not in wx_data:
|
||||
LOG.error("Couldn't fetch forecast.weather.gov '{}'".format(wx_data))
|
||||
wx_data = {"location": {"areaDescription": "Unknown Location"}}
|
||||
|
||||
reply = "{}: {} {}' {},{} {}h ago".format(
|
||||
searchcall,
|
||||
wx_data["location"]["areaDescription"],
|
||||
|
Loading…
Reference in New Issue
Block a user