Files
Calender/config.py
Ludwig Mey 93b2dad8fd Add photo slideshow screensaver with inactivity timer
- After 1 hour of inactivity the screen switches to a fullscreen
  crossfade slideshow of photos from static/photos/
- Touch anywhere on screen to dismiss and return to the calendar
- /api/photos endpoint serves a shuffled list of images from static/photos/
- Two-slot A/B image swap for smooth 1.5s crossfades; next image preloads
  in the background while current is displayed (15s per photo)
- Slideshow only activates if static/photos/ contains at least one image

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-27 21:00:22 +12:00

44 lines
2.1 KiB
Python

import os
from dotenv import load_dotenv
# Load environment variables
load_dotenv()
class Config:
# Flask settings
SECRET_KEY = os.getenv('FLASK_SECRET_KEY', 'dev-secret-key-change-in-production')
# OpenWeatherMap API settings
OPENWEATHER_API_KEY = os.getenv('OPENWEATHER_API_KEY', '')
WEATHER_LOCATION = os.getenv('WEATHER_LOCATION', 'Hamilton,NZ')
WEATHER_LAT = float(os.getenv('WEATHER_LAT', '-37.7870'))
WEATHER_LON = float(os.getenv('WEATHER_LON', '175.2793'))
WEATHER_UNITS = 'metric' # Use Celsius
# Google Calendar settings
GOOGLE_CALENDAR_ID = os.getenv('GOOGLE_CALENDAR_ID', '')
GOOGLE_CALENDAR_ICAL_URL = os.getenv('GOOGLE_CALENDAR_ICAL_URL', '')
CALENDAR_DAYS_AHEAD = int(os.getenv('CALENDAR_DAYS_AHEAD', '5'))
# Update intervals (in seconds)
IMAGE_ROTATION_INTERVAL = int(os.getenv('IMAGE_ROTATION_INTERVAL', '300')) # 5 minutes
WEATHER_UPDATE_INTERVAL = int(os.getenv('WEATHER_UPDATE_INTERVAL', '900')) # 15 minutes
CALENDAR_UPDATE_INTERVAL = int(os.getenv('CALENDAR_UPDATE_INTERVAL', '300')) # 5 minutes
JOKE_UPDATE_INTERVAL = int(os.getenv('JOKE_UPDATE_INTERVAL', '3600')) # 1 hour
# Directories
BACKGROUNDS_DIR = os.path.join('static', 'backgrounds')
PHOTOS_DIR = os.path.join('static', 'photos')
CREDENTIALS_DIR = 'credentials'
# Family members for event color-coding.
# Event titles prefixed with "[Alias]" (e.g. "[Daniel] Football Practice")
# are tagged with that member's name/color and the prefix is stripped for display.
FAMILY_MEMBERS = [
{'key': 'dad', 'name': 'Ludwig', 'aliases': ['ludwig', 'dad'], 'color': '#4A90D9', 'bg': '#DCEAFB'},
{'key': 'mom', 'name': 'Michelle', 'aliases': ['michelle', 'mom'], 'color': '#D9669B', 'bg': '#FBDDEB'},
{'key': 'jason', 'name': 'Jason', 'aliases': ['jason'], 'color': '#5FA85B', 'bg': '#E1F2DD'},
{'key': 'daniel', 'name': 'Daniel', 'aliases': ['daniel'], 'color': '#D9A53B', 'bg': '#FBEFD3'},
]
DEFAULT_MEMBER = {'key': 'family', 'name': 'Family', 'color': '#8C8C8C', 'bg': '#E9E9E9'}