diff options
author | Starfall <us@starfall.systems> | 2022-11-29 17:41:00 -0600 |
---|---|---|
committer | Starfall <us@starfall.systems> | 2022-11-29 17:41:00 -0600 |
commit | 061ecde51d51ebdb5ab8a4d26c944b95c68d88cb (patch) | |
tree | 330f725410613576cef588376f658f6e8b18801f /weather.py | |
parent | 739fe7fe8a2534a50e7ec6bd9f74db9835eed939 (diff) |
also print certainty and urgency for alerts
Diffstat (limited to 'weather.py')
-rwxr-xr-x | weather.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/weather.py b/weather.py index 2f769e6..a30a4e7 100755 --- a/weather.py +++ b/weather.py @@ -35,7 +35,7 @@ def print_alerts(county, zone): print(f'===================={term.RESET}') for alert in alerts.get('@graph'): print(f'{alert.get("headline")}') - print(f' Severity: {alert.get("severity")}') + print(f' {alert.get("severity")} - {alert.get("certainty")} - {alert.get("urgency")}') print(f' Until: {alert.get("expires")}') print(f'{alert.get("description")}') # TODO description can be quite long @@ -51,6 +51,7 @@ def print_alerts(county, zone): # messageType: Alert, Update # can construct the headline ourseves as f'{event} issued {sent} [until {end}] by {senderName}' + print() def print_forecast(forecast_url): # TODO pick up gridId AFC (AER/ALU), AFG, AJK, BOX< CAE, DLH, FSD, HGX, HNX, LIX, LWX, MAF, MFR, MLB, MRX, MTR, PIH and reduce gridX and gridY by 1 - known issue @@ -90,6 +91,7 @@ def main(): # TODO can hazardous weather outlook be gotten programatically? + forecast_url = point.get('forecast') print_forecast(forecast_url) |