Files
Calender/config.py
Ludwig Mey 98b4de70e7 Color-code events by family member name anywhere in title
- Fuzzy name matching: if a member's name appears anywhere in the event
  title (word boundary, case-insensitive), it gets their color — no
  [prefix] required. e.g. "Daniel's Week" → green, "Jason Karate" → blue
- More vibrant card color palette (deeper pastels, stronger border accent)
- Bolder event title text and slightly thicker left border for clarity

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-27 21:17:29 +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': '#1A6BBF', 'bg': '#C2DEFA'},
{'key': 'mom', 'name': 'Michelle', 'aliases': ['michelle', 'mom'], 'color': '#BF1A6B', 'bg': '#FAC2DC'},
{'key': 'jason', 'name': 'Jason', 'aliases': ['jason'], 'color': '#1A8C1E', 'bg': '#BFEDCA'},
{'key': 'daniel', 'name': 'Daniel', 'aliases': ['daniel'], 'color': '#BF7A00', 'bg': '#FAE4A0'},
]
DEFAULT_MEMBER = {'key': 'family', 'name': 'Family', 'color': '#666666', 'bg': '#E0E0E0'}