Style the weather forecast after classic cable graphics
This commit is contained in:
@@ -84,7 +84,7 @@ class NWSWeather:
|
||||
"current": observation_data,
|
||||
"almanac": {key: local_time(daylight[key]) for key in ("sunrise", "sunset")},
|
||||
"hourly": future_periods(hourly, now)[:6],
|
||||
"forecast": future_periods(forecast, now)[:6],
|
||||
"forecast": future_periods(forecast, now)[:7],
|
||||
"alerts": [
|
||||
{"event": alert["event"], "headline": alert.get("headline")}
|
||||
for alert in alerts or [] if after(alert.get("ends") or alert.get("expires"), now)
|
||||
@@ -116,7 +116,8 @@ def observation(body):
|
||||
def periods(body, limit):
|
||||
return [
|
||||
{"name": item["name"] or local_time(datetime.fromisoformat(item["startTime"])), "start": item["startTime"], "end": item["endTime"],
|
||||
"temperature": item["temperature"], "conditions": item["shortForecast"]}
|
||||
"temperature": item["temperature"], "conditions": item["shortForecast"],
|
||||
"daytime": item["isDaytime"]}
|
||||
for item in body["properties"]["periods"][:limit]
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user