Refine calendar display layout and features

Major improvements to the calendar display application:

- Redesigned weather display: moved forecast to header alongside time
- Added 3-day forecast with icons and high/low temps in header
- Simplified main layout: removed separate weather section, calendar now full-width
- Made layout more compact to fit on one screen without scrolling
- Added 2 new background images for rotation
- Updated image rotation interval to 1 minute
- Improved responsive design and spacing

The display now shows:
- Header: Time/date on left, current weather + 3-day forecast on right
- Main: Full-width calendar events section
- Footer: Dad joke

All elements now fit on a single screen with a clean, readable layout.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-14 17:52:36 +13:00
parent ae11476245
commit 71a450b968
7 changed files with 112 additions and 97 deletions

6
app.py
View File

@@ -44,7 +44,7 @@ def get_weather():
current_response.raise_for_status()
current_data = current_response.json()
# Fetch 5-day forecast
# Fetch 3-day forecast
forecast_url = f"https://api.openweathermap.org/data/2.5/forecast"
forecast_response = requests.get(forecast_url, params=params, timeout=10)
forecast_response.raise_for_status()
@@ -54,9 +54,9 @@ def get_weather():
daily_forecast = []
seen_dates = set()
for item in forecast_data['list'][:40]: # Next 5 days (8 forecasts per day)
for item in forecast_data['list'][:40]: # Next 3 days (8 forecasts per day)
date = datetime.fromtimestamp(item['dt']).date()
if date not in seen_dates and len(daily_forecast) < 5:
if date not in seen_dates and len(daily_forecast) < 3:
seen_dates.add(date)
daily_forecast.append({
'date': date.strftime('%a'),