From 061ecde51d51ebdb5ab8a4d26c944b95c68d88cb Mon Sep 17 00:00:00 2001 From: Starfall Date: Tue, 29 Nov 2022 17:41:00 -0600 Subject: also print certainty and urgency for alerts --- weather.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'weather.py') 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) -- cgit