236 Commits
v2.2 ... v2.5

Author SHA1 Message Date
Evan Salter
711482d59a Add news source logos (#143)
* Download favicons; Display first one

* Refine image loading

* Switch to static images

* Remove unused var

* Fix

* Clean up

* Fix width fallback
2025-12-09 10:59:18 -05:00
Evan Salter
694c7cec10 Center time better (#144)
* Center time better

* Use ampm spacing of 4 pixels
2025-12-09 10:58:57 -05:00
Chuck
bb76f01c05 Modify README for BETA Plugins branch usage (#142)
Updated instructions for using the BETA Plugins branch.

Signed-off-by: Chuck <33324927+ChuckBuilds@users.noreply.github.com>
2025-12-02 14:37:50 -05:00
Chuck
3382cabe25 Revise README with branch usage and install command (#139)
Updated instructions for using the Plugins branch and modified installation command.

Signed-off-by: Chuck <33324927+ChuckBuilds@users.noreply.github.com>
2025-11-13 15:32:15 -05:00
Alex Resnick
c06893f3e0 Use current season for Leaderboard (#128)
Signed-off-by: Alex Resnick <adr8292@gmail.com>
Co-authored-by: Alex Resnick <adr8282@gmail.com>
2025-11-04 08:28:38 -06:00
Chuck
5c97b4baae Virginia Tech Logo (#133)
adding VT.png

Signed-off-by: Chuck <33324927+ChuckBuilds@users.noreply.github.com>
2025-11-03 09:16:50 -05:00
Alex Resnick
cd0c43fb3a Use EST for Active Games and 1 Day lookback (#129)
Signed-off-by: Alex Resnick <adr8292@gmail.com>
2025-10-31 10:22:45 -05:00
Chuck
0a312cc912 Add Utah Mammoth NHL PNG (#131)
Added UTA.png logo to NHL Logos

Signed-off-by: Chuck <33324927+ChuckBuilds@users.noreply.github.com>
2025-10-31 10:54:38 -04:00
Chuck
0dc44c94b3 Update requirements.txt (#122)
clamp Pillow version under 12 to prevent imaging core error

Signed-off-by: Chuck <33324927+ChuckBuilds@users.noreply.github.com>
2025-10-20 09:09:55 -04:00
Chuck
ce79ccaec2 Feature/music skip delay (#115)
* feat: Add configurable delay for music module skip when nothing playing

- Add 'skip_when_nothing_playing' and 'skip_delay_seconds' config options
- Implement timer-based skip logic that waits 2 seconds before skipping
- Reset timer when music resumes or display is deactivated
- Improve user experience by preventing jarring immediate skips
- Maintains backward compatibility with existing configurations

* feat: Add live priority support to music manager

- Add 'live_priority' and 'live_game_duration' config options for music
- Integrate music manager into live priority rotation system
- Add 'music_live' mode that participates in live priority takeover
- Music manager joins live priority rotation when actively playing
- Supports future plugin ecosystem with consistent live priority interface
- Maintains backward compatibility with existing music configurations

* feat: Add new music settings to web interface

- Add 'Skip When Nothing Playing' checkbox and delay configuration
- Add 'Enable Live Priority' checkbox and duration configuration
- Update music form JavaScript to save all new settings
- Users can now configure music skip behavior and live priority through web UI

* fix: Improve music live priority integration

- Enhanced music live content detection with detailed logging
- Modified live priority logic to properly handle music mode
- Added music to live priority sports collection when actively playing
- Updated live priority rotation to handle music mode correctly
- Improved live priority takeover logic for music manager
- Music now properly participates in live priority rotation when playing

* perf: Reduce logging frequency for music live priority

- Add timestamp-based throttling to music live priority logging
- Info messages now only appear every 30 seconds instead of every few milliseconds
- Debug messages are also throttled to reduce log spam
- Maintains visibility of important events while reducing noise

* Fix unreachable code bug in music live priority handling

- Moved music live priority logic outside the sports iteration loop where it was unreachable
- The 'if sport == music' block was never executed since 'music' wasn't in the sports list
- Consolidated music handling in its own separate section for cleaner code structure
- Added music configuration options to config template
- Maintained exact same functionality while eliminating dead code

* Fix music_live_game_duration setting not being used

- Modified get_current_duration() method to check for music live priority mode
- When music is in live priority mode, use configured live_game_duration setting
- Added proper config reading for music_live_game_duration during initialization
- Ensures music displays for the configured duration when in live priority mode

* Fix stale timestamp bug in live priority debug logging

- Fixed issue where debug log at line 1240 was using a stale current_time variable
- The current_time variable was conditionally reassigned in music live priority check
- This caused inconsistent log throttling behavior
- Now uses fresh current_time_for_debug variable for accurate throttling
2025-10-16 16:46:37 -04:00
Chuck
9c313cdac3 Update README.md (#120)
more detail around choosing legacy OS

Signed-off-by: Chuck <33324927+ChuckBuilds@users.noreply.github.com>
2025-10-11 19:13:08 -04:00
Chuck
ed22f5cd01 Fix: Suppress Werkzeug production warning in web interface (#117)
- Add allow_unsafe_werkzeug=True parameter to socketio.run()
- Allows web UI to run cleanly when eventlet is not available
- Falls back gracefully to Werkzeug without production warnings
2025-10-10 21:38:06 -04:00
Chuck
98d3ed7d91 Fix NBA leaderboard team ID field for logo fetching (#116)
* Fix NBA leaderboard team ID field for logo fetching

- Add missing 'id' field to NBA team standings data structure
- Enables proper logo fetching from assets/sports/nba_logos/
- Fixes 'id' KeyError when creating NBA leaderboard images
- Includes diagnostic and test scripts for verification

* Add NBA logo downloader script and documentation

- download_nba_logos.py: Script to download all 30 NBA team logos from ESPN API
- README_NBA_LOGOS.md: Comprehensive documentation for the logo downloader
- Supports force re-download and quiet modes
- Downloads to assets/sports/nba_logos/ for leaderboard integration

* replace NBA Logos

* return NBA logo
2025-10-10 18:27:36 -04:00
Chuck
584a4f258e Update README.md (#109)
added Rmatze's 4mm pixel matrix stands

Signed-off-by: Chuck <33324927+ChuckBuilds@users.noreply.github.com>
2025-10-08 19:11:16 -05:00
Chuck
7a61ecff7b Feature/memory optimization config (#108)
* feat(config): optimize memory usage to prevent OOM killer

- Reduce brightness from 95 to 50 to lower power consumption
- Reduce refresh rate from 120Hz to 100Hz to reduce CPU/memory pressure
- Reduce background service workers from 3 to 1 per manager
- Change hardware mapping from adafruit-hat-pwm to adafruit-hat
- Expected memory savings: ~700MB reduction in background service usage
- Addresses SIGKILL errors caused by memory exhaustion on Raspberry Pi

Fixes: OOM killer terminating ledmatrix.service with status=9/KILL

* revert display brightness

* refactor(background-service): hardcode optimized settings and remove config blocks

- Hardcode background service to 1 worker in all managers
- Remove background_service config blocks from template
- Simplify configuration for users - no need to adjust system settings
- Memory optimization: ~700MB reduction in background service usage
- Settings: 1 worker, 30s timeout, 3 retries (hardcoded)

Files updated:
- src/base_classes/sports.py
- src/leaderboard_manager.py
- src/odds_ticker_manager.py
- src/soccer_managers.py
- src/milb_manager.py
- config/config.template.json

This prevents OOM killer errors by reducing memory usage from
15 background threads to 5 threads total across all managers.

* remove fallback in case of background service failure
2025-10-08 19:10:54 -05:00
Chuck
58bbb5fe6f fix(nba): Add missing PIL imports for Image and ImageFont (#103)
- Added PIL import for Image and ImageFont classes
- Resolves NameError when running display_controller.py
- Fixes type hint for _load_and_resize_logo method
2025-10-05 16:05:47 -04:00
Alex Resnick
ee650820a9 Fix Config Template (#102)
Co-authored-by: Alex Resnick <adr8282@gmail.com>
2025-10-05 15:36:32 -04:00
Alex Resnick
fb38a5a814 Create Basketball Base Class and Consolidate Basketball Managers (#97)
* Create basketball Base class

* Migrate NBA

* Add NCAA Mens Basketball

* Add NCAA Women's Basketball

* Add WNBA

---------

Co-authored-by: Alex Resnick <adr8282@gmail.com>
2025-10-05 15:22:00 -04:00
Alex Resnick
3406234e00 Add NCAA Women's Hockey (#96)
* Add NCAA Womens Hockey

* Fix status text

---------

Co-authored-by: Alex Resnick <adr8282@gmail.com>
2025-10-05 15:19:03 -04:00
Alex Resnick
9ba76b56d7 Update Football display. Add End of Period text and long down distance for larger screens (#101)
Co-authored-by: Alex Resnick <adr8282@gmail.com>
2025-10-05 15:17:49 -04:00
Chuck
f3d02e07ea Feature/static image manager (#95)
* feat(static-image): Add static image manager with web interface

- Create StaticImageManager class with image scaling and transparency support
- Add configuration options for display duration, zoom scale, and background color
- Integrate with display controller and web interface
- Add image upload functionality to web interface
- Support for various image formats with proper scaling
- Efficient image processing with aspect ratio preservation
- Ready for future scrolling feature implementation

* fix(static-image): Move display duration to main display_durations block

- Remove display_duration from static_image config section
- Update StaticImageManager to read duration from display.display_durations.static_image
- Remove display duration field from web interface form
- Update web interface JavaScript to not include display_duration in payload
- Follows same pattern as all other managers in the project

* feat(static-image): Add fit to display option

- Add fit_to_display checkbox to automatically scale images to fit display
- When enabled, images are scaled to fit display dimensions while preserving aspect ratio
- When disabled, manual zoom_scale control is available
- Update web interface with smart form controls (zoom scale disabled when fit to display is on)
- Prevents stretching or cropping - images are always properly fitted
- Default to fit_to_display=true for better user experience

* refactor(static-image): Remove zoom_scale and simplify to fit_to_display only

- Remove zoom_scale option entirely as it was confusing and redundant
- Simplify image processing to always fit to display dimensions
- Remove zoom_scale field from web interface
- Clean up JavaScript to remove zoom scale logic
- Images are now always properly fitted without stretching or cropping
- Much simpler and more intuitive user experience
2025-10-05 10:46:36 -04:00
Chuck
a115a1ed6b fix(web): Add willReadFrequently attribute to Canvas2D contexts (#100)
- Add willReadFrequently: true to all getContext('2d') calls in templates/index_v2.html
- Fixes Canvas2D performance warning for multiple readback operations using getImageData
- Improves performance for LED matrix preview rendering with frequent pixel sampling
2025-10-05 10:46:16 -04:00
Chuck
d83ff6a121 Update README.md
Update readme to advise installation of Rasbian Legacy (Bookworm) vs the brand new Trixie that has incompatible requirements

Signed-off-by: Chuck <33324927+ChuckBuilds@users.noreply.github.com>
2025-10-02 17:54:51 -04:00
Alex Resnick
f6e2881f2f Multiple Sports Fixes (#93) 2025-10-02 16:35:17 -05:00
Chuck
6c493e8329 Update README.md
added 10a power supply

Signed-off-by: Chuck <33324927+ChuckBuilds@users.noreply.github.com>
2025-10-01 21:24:28 -04:00
Chuck
e749925c0a Update README.md
formatting hardware requirements

Signed-off-by: Chuck <33324927+ChuckBuilds@users.noreply.github.com>
2025-10-01 21:20:21 -04:00
Chuck
f0b61e3bd9 Update README.md
add another hat

Signed-off-by: Chuck <33324927+ChuckBuilds@users.noreply.github.com>
2025-10-01 21:16:40 -04:00
Chuck
83f76dbdce Update config.template.json
Disable all managers except clock by default for template

Signed-off-by: Chuck <33324927+ChuckBuilds@users.noreply.github.com>
2025-10-01 10:24:14 -04:00
Chuck
4adb7b49ba fix: Resolve permission errors in soccer_manager logo downloads (#90)
- Fix download_missing_logo call to use correct signature with Path parameter
- Add comprehensive permission error handling with helpful error messages
- Include instructions to run fix_assets_permissions.sh when permission errors occur
- Improve error logging for directory listing and logo access permission issues
- Add test script to verify permission error handling works correctly

Fixes: [Errno 13] Permission denied errors when downloading soccer team logos
2025-10-01 10:14:34 -04:00
Alex Resnick
2d6c238ea0 Consolidate Baseball leagues to completely use Baseball class (#84)
* Consolidate MLB to completely use Baseball class

* typos

* add OT period number

* Add new live class and abstracts

* NCAA BB is consolidated

* MLB Working

* NCAA Hockey and NHL working

* didn't need wrapper function

* Add hockey shots on goal

* cleanup

---------

Co-authored-by: Alex Resnick <adr8282@gmail.com>
2025-09-30 17:55:45 -04:00
Chuck
e584026bda cursor rules (#87) 2025-09-29 21:42:12 -04:00
Chuck
1b52928e1a Update README.md
Quick update on Readme and organization with collapsible headers.

Signed-off-by: Chuck <33324927+ChuckBuilds@users.noreply.github.com>
2025-09-29 16:34:53 -04:00
Chuck
38c1bff9dc fix(nhl): Add missing games_list initialization in NHLRecentManager (#85)
- Add self.games_list = [] to NHLRecentManager.__init__ method
- Fixes AttributeError when display method tries to access games_list
- Follows same pattern as other RecentManager classes
2025-09-29 08:45:48 -04:00
Chuck
08af182380 Feature/nhl background service integration (#77)
* feat(nhl): Integrate NHL manager with background service

- Fix NHL data source to use ESPN API instead of NHL.com API
- Add background service integration following NFL/NCAA pattern
- Add HTTP session with retry strategy and proper headers
- Add background fetch request tracking and callback handling
- Add synchronous fallback when background service disabled
- Update _fetch_nhl_api_data() to use background threading
- Simplify _fetch_data() method for consistency
- Add _fetch_nhl_api_data_sync() for direct API fallback

This brings NHL manager in line with other sports managers and resolves
the 'No events found in ESPN API response' error by using the correct
ESPN API endpoint that matches the existing parsing logic.

* update NHL
2025-09-28 16:34:41 -04:00
Alex Resnick
1ee805901f Fix odds and more (#81)
* fix(odds): Resolve incorrect sport and league parameters in _fetch_odds calls

- Fixed SportsCore._fetch_data() to call _fetch_odds(game) instead of _fetch_odds(game, sport_key, sport_key)
- Updated _fetch_odds method signature to accept only game parameter
- Added _fetch_odds_with_params helper method for sport-specific implementations
- Updated sport-specific managers to use correct sport and league parameters:
  - NFL: football/nfl
  - NCAA Football: football/college-football
  - NCAA Hockey: hockey/mens-college-hockey
- Ensures odds are fetched with correct ESPN API endpoints

Fixes #79

* Fix odds and other things

* update hockey

* fix rankings

* update imports

* Fix Logo Cache

* Add show_favorite_team_only attribute

---------

Co-authored-by: ChuckBuilds <33324927+ChuckBuilds@users.noreply.github.com>
Co-authored-by: Alex Resnick <adr8282@gmail.com>
2025-09-28 16:34:21 -04:00
Chuck
a98760f4d9 team switch logging (#73)
Works and doesn't seem to break anything else
2025-09-27 12:50:50 -04:00
Chuck
fc06493990 Fix/logo download permission error (#70)
* fix: Resolve permission errors when downloading sports logos

- Fix fix_assets_permissions.sh to use correct directory name 'ncaa_logos' instead of 'ncaa_fbs_logos'
- Add comprehensive permission checking in logo downloader
- Improve error handling with specific permission error messages
- Add write access testing before attempting logo downloads
- Provide clear instructions to run permission fix script when errors occur

Fixes: [Errno 13] Permission denied errors when downloading team logos like SELA.png

* fix: Update first_time_install.sh to use correct ncaa_logos directory

- Fix manual permission setting section to use 'ncaa_logos' instead of 'ncaa_fbs_logos'
- Ensures consistency across all installation scripts
- Prevents permission issues during first-time installation

* fix: Update all remaining references from ncaa_fbs_logos to ncaa_logos

- Fix README.md directory reference
- Update wiki documentation files (MANAGER_GUIDE_COMPREHENSIVE.md, TEAM_ABBREVIATIONS_AND_LEAGUE_SLUGS.md)
- Fix test files (save_missing_teams.py, test_ranking_toggle.py, test_leaderboard_simple.py)
- Update missing_team_logos.txt with correct directory paths

Ensures complete consistency across the entire project for NCAA logo directory naming.
2025-09-25 19:21:26 -04:00
Chuck
1bc4e531ae Fix/web UI display preview resolution (#69)
* fix(web-ui): Use config display dimensions instead of hardcoded 128x32 in Live Display Preview

- Updated /api/display/current endpoint to calculate display dimensions from config
- Modified HTML template to use config dimensions as fallbacks instead of hardcoded 128x32
- Display preview now shows correct resolution based on cols*chain_length x rows*parallel
- Maintains backward compatibility with existing API responses

* feat(web-ui): Add missing NCAAM Hockey sports manager to web interface

- Added NCAAM Hockey import and OnDemandRunner support
- Updated sports configuration UI to include NCAAM Hockey
- Fixed MLB and MiLB config keys to match template (_scoreboard suffix)
- All sports managers now properly represented in web interface:
  - NFL, MLB, MiLB, NHL, NBA, NCAA FB, NCAA Baseball, NCAAM Basketball, NCAAM Hockey, Soccer
- Maintains backward compatibility with existing configurations

* fix(web-ui): Improve on-demand button error handling and prevent crashes

- Enhanced error handling in OnDemandRunner with better logging and fallback modes
- Added robust display manager initialization with fallback support
- Improved error reporting via WebSocket to client for real-time feedback
- Added input validation for on-demand mode parameters
- Enhanced client-side error handling with better user notifications
- Added safety checks to prevent multiple on-demand instances
- Fixed display manager initialization issues that caused crashes
- Improved error recovery and graceful degradation
2025-09-25 19:08:21 -04:00
Chuck
abceb8205c Feature/ap top 25 dynamic teams (#68)
* feat: Add AP Top 25 dynamic teams feature

- Add DynamicTeamResolver for resolving AP_TOP_25, AP_TOP_10, AP_TOP_5 to actual team abbreviations
- Integrate dynamic team resolution into SportsCore base class
- Add comprehensive test suite for dynamic team functionality
- Update config template with AP_TOP_25 example
- Add complete documentation for the new feature

Features:
- Automatic weekly updates of AP Top 25 rankings
- 1-hour caching for performance optimization
- Support for AP_TOP_25, AP_TOP_10, AP_TOP_5 dynamic teams
- Seamless integration with existing favorite teams system
- Comprehensive error handling and edge case support

Tests:
- Unit tests for core dynamic team resolution
- Integration tests for configuration scenarios
- Performance tests for caching functionality
- Edge case tests for unknown dynamic teams

All tests passing with 100% success rate.

* docs: Update wiki submodule with AP Top 25 documentation

- Add comprehensive documentation for AP Top 25 dynamic teams feature
- Include usage examples, configuration guides, and troubleshooting
- Update submodule reference to include new documentation

* feat: Add AP_TOP_25 support to odds ticker

- Integrate DynamicTeamResolver into OddsTickerManager
- Resolve dynamic teams for all enabled leagues during initialization
- Add comprehensive logging for dynamic team resolution
- Support AP_TOP_25, AP_TOP_10, AP_TOP_5 in odds ticker
- Add test suite for odds ticker dynamic teams integration

Features:
- Odds ticker now automatically resolves AP_TOP_25 to current top 25 teams
- Shows odds for all current AP Top 25 teams automatically
- Updates weekly when rankings change
- Works seamlessly with existing favorite teams system
- Supports mixed regular and dynamic teams

Tests:
- Configuration integration tests
- Multiple league configuration tests
- Edge case handling tests
- All tests passing with 100% success rate
2025-09-25 18:26:30 -04:00
Chuck
5bfcdaf4ff Fix/odds ticker manager log spam (#65)
* fix(odds-ticker): Reduce log spam from insufficient time warnings

- Add _insufficient_time_warning_logged flag to prevent repeated warnings
- Log insufficient time warning only once per display session
- Reset warning flag when starting new display or updating data
- Maintain debug logging for scroll position resets to aid debugging

This addresses the frequent 'Not enough time to complete content display'
warnings that were flooding the logs every few milliseconds.

* fix(leaderboard): Reduce log spam from progress and FPS logging

- Change progress logging from every 50 pixels to every 5 seconds
- Increase FPS logging interval from 10 seconds to 30 seconds
- Add progress_log_interval and last_progress_log_time variables
- Reset progress log timer when starting new display sessions or updating data
- Maintain debug capability while significantly reducing log volume

This addresses the frequent 'Leaderboard progress' and 'Leaderboard FPS'
messages that were flooding the logs during leaderboard scrolling.

* fix(music): Reduce log spam from track update logging

- Add throttling mechanism for track update logging
- Log track updates only when track title changes or after 5 seconds
- Track last_logged_track_title and last_track_log_time to prevent spam
- Maintain debug logging for throttled updates
- Apply throttling to both regular updates and first valid data logging

This addresses the frequent 'Track info updated' messages that were
flooding the logs every few hundred milliseconds for the same track.

* fix(logo-downloader): Fix TA&M filename normalization issue

- Add special case for TA&M to keep as TA&M instead of converting to TAANDM
- This fixes the issue where code was looking for TAANDM.png instead of TA&M.png
- The actual logo file exists as TA&M.png, so normalization was causing file not found errors
- Prevents unnecessary download attempts and permission errors for existing files

Fixes the error: 'Logo not found for TA&M at assets/sports/ncaa_logos/TAANDM.png'

* fix(logo-downloader): Implement robust filename variation handling

- Add get_logo_filename_variations() method to handle multiple filename formats
- Update _load_and_resize_logo() to try filename variations before downloading
- Handles cases like TA&M.png vs TAANDM.png gracefully
- Maintains backward compatibility with existing normalized filenames
- Prevents issues with special characters in filenames while supporting existing files

This addresses the ampersand filename issue more robustly by:
1. First trying the original filename (TA&M.png)
2. Falling back to normalized filename (TAANDM.png) if needed
3. Only attempting downloads if no variations exist

* fix(leaderboard): Reduce log spam from end reached messages

- Add _end_reached_logged flag to prevent repeated end reached warnings
- Log 'Leaderboard reached end' and 'scrolling stopped' messages only once per display session
- Maintain debug logging for throttled messages to aid debugging
- Reset flag when starting new display sessions or updating data
- Apply same throttling pattern used in odds ticker manager

This addresses the frequent 'Leaderboard reached end' and 'scrolling stopped'
messages that were flooding the logs every few milliseconds when at the end.
2025-09-25 10:28:55 -04:00
Chuck
ad8a652183 Fix leaderboard scrolling performance after PR #39 merge (#63)
* Fix leaderboard scrolling performance after PR #39 merge

- Restore leaderboard background updates that were accidentally removed
- Fix duration method call from get_dynamic_duration() back to get_duration()
- Restore proper fallback duration (600s instead of 60s) for leaderboard
- Add back sports manager updates that feed data to leaderboard
- Fix leaderboard defer_update priority to prevent scrolling lag

These changes restore the leaderboard's dynamic duration calculation
and ensure it gets proper background updates for smooth scrolling.

* Apply PR #60 leaderboard performance optimizations

- Change scroll_delay from 0.05s to 0.01s (100fps instead of 20fps)
- Remove conditional scrolling logic - scroll every frame for smooth animation
- Add FPS tracking and logging for performance monitoring
- Restore high-framerate scrolling that was working before PR #39 merge

These changes restore the smooth leaderboard scrolling performance
that was achieved in PR #60 but was lost during the PR #39 merge.

* Fix critical bugs identified in PR #39 review

- Fix record filtering logic bug: change away_record == set to away_record in set
- Fix incorrect sport specification: change 'nfl' to 'ncaa_fb' for NCAA Football data requests
- These bugs were causing incorrect data display and wrong sport data fetching

Addresses issues found by cursor bot in PR #39 review:
- Record filtering was always evaluating to False
- NCAA Football was fetching NFL data instead of college football data

* Enhance cache clearing implementation from PR #39

- Add detailed logging to cache clearing process for better visibility
- Log cache clearing statistics (memory entries and file count)
- Improve startup logging to show cache clearing and data refetch process
- Addresses legoguy1000's comment about preventing stale data issues

This enhances the cache clearing implementation that was added in PR #39
to help prevent legacy cache issues and stale data problems.

* continuing on base_classes - added baseball and api extractor since we don't use ESPN api for all sports

* tests

* fix missing duration

* ensure milb, mlb, ncaa bb are all using new baseball base class properly

* cursor rule to help with PR creation

* fix image call

* fix _scoreboard suffix on milb, MLB
2025-09-25 09:34:20 -04:00
Alex Resnick
76a9e98ba7 Created Base Sports Classes (#39)
* rebase

* Update NFL and NCAA FB fetch

* update FB updates

* kinda working, kinda broken

* Fixed and update loggers

* move to individual files

* timeout updates

* seems to work well

* Leaderboard overestimates time

* ignore that

* minor syntax updates

* More consolidation but i broke something

* fixed

* Hockey seems to work

* Fix my changes to logo downloader

* even more consolidation

* fixes

* more cleanup

* inheritance stuff

* Change football to ESPN down text, it does what ur already doing. Change color to red on Red ZOne

* Fix leaderboard

* Update football.py

Signed-off-by: Alex Resnick <adr8292@gmail.com>

* Minor fixes

* don't want that

* background fetch

* whoops

---------

Signed-off-by: Alex Resnick <adr8292@gmail.com>
Co-authored-by: Alex Resnick <adr8282@gmail.com>
Co-authored-by: ChuckBuilds <33324927+ChuckBuilds@users.noreply.github.com>
2025-09-24 17:10:41 -04:00
Chuck
42e14f99b0 Fix duplicate caching (#62)
* Fix duplicate/redundant caching issue

- Add get_background_cached_data() and is_background_data_available() methods to CacheManager
- Update sports managers to use background service cache instead of individual caching
- Ensure consistent cache key generation between background service and managers
- Eliminate redundant API calls by making Recent/Upcoming managers cache consumers
- Fix cache miss issues where TTL < update interval

This addresses GitHub issue #57 by implementing a cleaner caching architecture
where the background service is the primary data source and managers are cache consumers.

* Update remaining sports managers to use background service cache

- Update NHL managers to use background service cache
- Update NCAA Football managers to use background service cache
- Update NCAA Hockey managers to use background service cache
- Update MLB managers to use background service cache for Recent/Upcoming

All sports managers now use the new caching architecture to eliminate
duplicate caching and redundant API calls.

* cache improvements

* updated cache manager
2025-09-24 16:13:41 -04:00
Chuck
b1295047e2 Feature/display modes web UI (#61)
* Fix leaderboard gap to use display width instead of hardcoded values

- Replace hardcoded spacing (40px) with display_manager.matrix.width
- Update gap calculation to use display width for blank screen simulation
- Fix display width logging to show correct value
- Ensures gap between league rotations matches actual display width

* Add display width gap to news manager

- Add display width gap at the beginning of news content
- Update total_scroll_width calculation to include display width gap
- Modify create_scrolling_image to draw text after display width gap
- Ensures news starts with blank screen period matching display width
- Removed duplicate create_scrolling_image method

* add Live, Recent, Upcoming toggles to display modes on website
2025-09-24 13:34:19 -04:00
Chuck
7c18b5126e Update README.md
Signed-off-by: Chuck <33324927+ChuckBuilds@users.noreply.github.com>
2025-09-23 11:25:24 -04:00
Chuck
b792401e07 Update README.md
Signed-off-by: Chuck <33324927+ChuckBuilds@users.noreply.github.com>
2025-09-22 22:13:56 -04:00
Chuck
80a5e491ed Update README.md
Signed-off-by: Chuck <33324927+ChuckBuilds@users.noreply.github.com>
2025-09-22 22:04:24 -04:00
Chuck
635fd4de73 Update README.md
Signed-off-by: Chuck <33324927+ChuckBuilds@users.noreply.github.com>
2025-09-22 21:59:05 -04:00
Chuck
a08951ab56 Update README.md
Signed-off-by: Chuck <33324927+ChuckBuilds@users.noreply.github.com>
2025-09-22 21:39:29 -04:00
Chuck
1a746e965e remove artificial scroll delay from leaderboard 2025-09-22 20:58:47 -04:00
Chuck
8cbdef3949 Fix/leaderboard timing improvements (#60)
* Fix leaderboard timing issues with comprehensive improvements

- Add maximum display time cap (120s) to prevent hanging
- Implement dynamic scroll speed tracking with runtime measurements
- Simplify complex timing logic that was causing hangs
- Add enhanced progress tracking and logging
- Add configurable safety buffer (10s)
- Update config template with new timing options
- Add comprehensive test suite for timing logic

Fixes the 30-second hanging issue reported in PR #53 by providing
multiple layers of protection against time overestimation.

* Simplify leaderboard timing to use long timeout with exception-based ending

- Remove complex dynamic duration calculations
- Remove safety buffer complexity
- Remove scroll speed tracking and measurements
- Use simple 10-minute timeout (600s) for both display_duration and max_display_time
- Let content determine when display is complete via existing StopIteration logic
- Update display controller to use simplified duration approach
- Clean up config template to remove unused timing settings

This approach is much more reliable than trying to predict content duration
and eliminates the hanging issues reported in PR #53.

* Fix configuration structure to use centralized display_durations

- Remove redundant display_duration from leaderboard section
- Use main display_durations.leaderboard (300s) for fixed duration mode
- Update leaderboard manager to read from centralized config
- Increase leaderboard default duration from 60s to 300s for better content coverage
- Maintain dynamic_duration option for user choice between fixed/dynamic modes
- Add comprehensive scroll behavior analysis and testing

This completes the leaderboard timing improvements with proper config structure.

* scroll every frame to be smoother like the stock ticker instead of waiting  per subsecond

* leaderboard block api calls while scrolling

* leaderboard debugging

* added leaderboard fps logging

* leaderboard frame control and optimizations

* background update memory leak for scrolling text found and first solution applied

* tuning scroll speeds

* working display scrolls

* revert scroll delay to 0.01 (about 100fps)

* revert min duration of leaderboard

* remove onetime test scripts
2025-09-22 20:42:10 -04:00
Alex Resnick
569576d4e8 Leaderboard hangs at end due to overestimate of time (#53)
* Leaderboard overestimates time


---------

Co-authored-by: Alex Resnick <adr8282@gmail.com>
2025-09-22 10:31:13 -04:00
Chuck
b0b5af8e21 Fix sports managers background updates and update intervals (#51)
- Add all sports managers to background updates in display_controller.py
- Add all sports managers to deferred updates when scrolling
- Fix hardcoded update intervals in NHL, NBA, NCAA Basketball, and NCAA Hockey managers
- Use config values for recent_update_interval and upcoming_update_interval
- Ensure all sports managers update continuously in background
- Only NFL managers had the season fetching issue, others were already optimized
2025-09-22 10:21:37 -04:00
Chuck
cf15409973 Fix schedule timezone handling (#52)
- Add proper timezone support to _check_schedule() method
- Use configured timezone instead of system local time
- Add pytz import for timezone handling
- Ensures schedule respects America/Chicago timezone setting
- Fixes issue where display wouldn't turn off at configured end_time
2025-09-21 21:15:57 -04:00
Chuck
1f2c1bfe0b Change default leaderboard scroll speed (#55)
* Fix Spotify flashing display issue

- Implement proper significant change detection for Spotify polling
- Only trigger significant changes for title, artist, album_art_url, is_playing changes
- Progress updates (progress_ms) are now non-significant and won't cause flashing
- Matches the logic used for YouTube Music polling
- Prevents unnecessary album art re-fetching and display clearing every 2 seconds

* change default leaderboard scroll speed
2025-09-21 21:15:30 -04:00
Chuck
8cad607d98 Fix display settings save error by adding missing config_type parameter (#58)
- Added config_type='main' to FormData when submitting display form
- Added proper HTTP error handling to catch non-JSON responses
- This fixes the 'Unexpected token <' JSON parsing error when saving display settings
2025-09-21 21:12:38 -04:00
Chuck
1dcda5613a Fix Spotify flashing display issue (#54)
- Implement proper significant change detection for Spotify polling
- Only trigger significant changes for title, artist, album_art_url, is_playing changes
- Progress updates (progress_ms) are now non-significant and won't cause flashing
- Matches the logic used for YouTube Music polling
- Prevents unnecessary album art re-fetching and display clearing every 2 seconds
2025-09-19 22:33:01 -04:00
Chuck
31ec0018be update timeout logic (#49) 2025-09-18 23:29:48 -04:00
Chuck
86049ca679 Fix nfl live update interval (#50)
* Fix NFL live update interval not being respected

- Add NFL managers to _update_modules() method in display_controller.py
- NFL managers now update continuously in background instead of only when displayed
- Fixes issue where NFL live data would only fetch once and never update
- NFL live manager now properly respects 30-second live_update_interval setting
- Also add NFL managers to deferred updates when display is scrolling

* Fix NFL Recent and Upcoming managers to use correct update intervals

- NFL Recent Manager now uses recent_update_interval (3600 seconds) instead of hardcoded 300
- NFL Upcoming Manager now uses upcoming_update_interval (3600 seconds) instead of hardcoded 300
- Ensures proper update intervals: Live=30s, Recent=3600s, Upcoming=3600s
- All managers respect their respective config intervals

* Fix NCAAFB managers to use correct update intervals and add to background updates

- NCAAFB Recent Manager now uses recent_update_interval (3600 seconds) instead of hardcoded 300
- NCAAFB Upcoming Manager now uses upcoming_update_interval (3600 seconds) instead of hardcoded 300
- Add NCAAFB managers to _update_modules() method in display_controller.py
- NCAAFB managers now update continuously in background instead of only when displayed
- Add NCAAFB managers to deferred updates when display is scrolling
- Ensures proper update intervals: Live=30s, Recent=3600s, Upcoming=3600s

* Fix NFL live manager to use cached data for fresh updates

- Change NFL Live Manager to use cache=True instead of cache=False
- NFL Live Manager was bypassing cache and not getting fresh data from background service
- Background service fetches and caches data, but live manager was ignoring the cache
- This fixes the issue where NFL live display shows stale data despite successful background fetches
- Live manager now gets fresh data from the background service cache

* Fix NFL live manager to force fresh data fetch when update interval passes

- NFL Live Manager now forces fresh fetch when update interval (30s) has passed
- Uses cache for immediate response but bypasses cache for fresh updates
- Adds logging to show when fresh fetch is forced
- This ensures live game data updates every 30 seconds with fresh scores/clock
- Fixes issue where live display was showing stale data despite background fetches

* Fix NFL live manager to always fetch fresh data from API

- NFL Live Manager now always fetches fresh data directly from ESPN API
- No cache usage for live games - ensures real-time scores and clock updates
- Live games should always show the latest information, not cached data
- This ensures live display updates every 30 seconds with current game state

* Fix NFL live manager to use synchronous API fetch for real-time updates

- NFL Live Manager now uses _fetch_nfl_api_data_sync() for direct API calls
- Bypasses background service and cache for immediate fresh data
- Ensures live games get real-time scores and clock updates every 30 seconds
- Direct API calls are faster and more reliable for live game data

* Fix NFL live manager to fetch only current games instead of entire season

- Create _fetch_current_nfl_games() method for live updates
- Only fetches current week's games, not entire 2025 season (335 events)
- Much faster API calls - only gets relevant live games
- Reduces API load and improves performance for live updates
- NFL Live Manager now fetches ~10-15 current games instead of 335 season games

* ensure live games aren't pulling whole season

* bugbot catches
2025-09-18 23:29:11 -04:00
Chuck
9dc1118d79 Feature/background season data (#46)
* Fix NCAAFB ranking display issue

- Remove duplicate ranking system that was drawing rankings behind team logos
- Old system (_get_rank) was drawing rankings at top of logos
- New system (_fetch_team_rankings) correctly draws rankings in bottom corners
- Remove old ranking calls from live, recent, and upcoming game drawing functions
- Remove unnecessary _fetch_rankings() calls from update methods
- Rankings now only appear in designated corner positions, not overlapping logos

Fixes issue where team rankings/betting lines were being drawn behind
team logos instead of replacing team records in the corners.

* Add missing show_ranking and show_records options to NCAAFB web UI

- Add show_ranking option to NCAAFB scoreboard config template
- Add show_records and show_ranking toggle switches to NCAAFB web UI
- Update JavaScript form collection to include new fields
- Users can now control whether to show team records or rankings via web interface

This completes the fix for NCAAFB ranking display - users can now enable
show_ranking in the web UI to see AP Top 25 rankings instead of team records.

* Implement Background Threading for Season Data Fetching

Phase 1: Background Season Data Fetching - COMPLETED

Key Features:
- Created BackgroundDataService class with thread-safe operations
- Implemented automatic retry logic with exponential backoff
- Modified NFL manager to use background service
- Added immediate partial data return for non-blocking display
- Comprehensive logging and statistics tracking

Performance Benefits:
- Main display loop no longer blocked by API calls
- Season data always fresh with background updates
- Better user experience during data fetching

Files Added/Modified:
- src/background_data_service.py (NEW)
- src/nfl_managers.py (updated)
- config/config.template.json (updated)
- test_background_service.py (NEW)
- BACKGROUND_SERVICE_README.md (NEW)

* Fix data validation issues in background service

- Add comprehensive data structure validation in NFL managers
- Handle malformed events gracefully with proper error logging
- Validate cached data format and handle legacy formats
- Add data validation in background service response parsing
- Fix TypeError: string indices must be integers, not 'str'

This fixes the error where events were being treated as strings
instead of dictionaries, causing crashes in recent/upcoming games.

* Phase 2: Apply Background Service to Major Sport Managers

 Applied background service support to:
- NCAAFB Manager (College Football)
- NBA Manager (Basketball)
- NHL Manager (Hockey)
- MLB Manager (Baseball)

🔧 Key Features Added:
- Background service initialization for each sport
- Configurable workers, timeouts, and retry settings
- Graceful fallback when background service is disabled
- Comprehensive logging for monitoring

⚙️ Configuration Updates:
- Added background_service config section to NBA
- Added background_service config section to NHL
- Added background_service config section to NCAAFB
- Each sport can independently enable/disable background service

📈 Performance Benefits:
- Season data fetching no longer blocks display loops
- Immediate response with cached/partial data
- Background threads handle heavy API calls
- Better responsiveness across all supported sports

Next: Apply to remaining managers (MiLB, Soccer, etc.)

* Fix Python compatibility issue in BackgroundDataService shutdown

🐛 Bug Fix:
- Fixed TypeError in ThreadPoolExecutor.shutdown() for older Python versions
- Added try/catch to handle timeout parameter compatibility
- Fallback gracefully for Python < 3.9 that doesn't support timeout parameter

🔧 Technical Details:
- ThreadPoolExecutor.shutdown(timeout=) was added in Python 3.9
- Older versions only support shutdown(wait=)
- Added compatibility layer with proper error handling

 Result:
- No more shutdown exceptions on older Python versions
- Graceful degradation for different Python environments
- Maintains full functionality on newer Python versions

* Phase 2 Complete: Background Service Applied to All Sport Managers

🎉 MAJOR MILESTONE: Complete Background Service Rollout

 All Sport Managers Now Support Background Service:
- MiLB Manager (Minor League Baseball)
- Soccer Manager (Multiple leagues: Premier League, La Liga, etc.)
- Leaderboard Manager (Multi-sport standings)
- Odds Ticker Manager (Live betting odds)

🔧 Technical Implementation:
- Background service initialization in all managers
- Configurable workers, timeouts, and retry settings
- Graceful fallback when background service is disabled
- Comprehensive logging for monitoring and debugging
- Thread-safe operations with proper error handling

⚙️ Configuration Support Added:
- MiLB: background_service config section
- Soccer: background_service config section
- Leaderboard: background_service config section
- Odds Ticker: background_service config section
- Each manager can independently enable/disable background service

📈 Performance Benefits Achieved:
- Non-blocking data fetching across ALL sport managers
- Immediate response with cached/partial data
- Background threads handle heavy API calls
- Significantly improved responsiveness
- Better user experience during data loading

🚀 Production Ready:
- All major sport managers now support background threading
- Comprehensive configuration options
- Robust error handling and fallback mechanisms
- Ready for production deployment

Next: Phase 3 - Advanced features (priority queuing, analytics)

* Update wiki submodule with Background Service documentation

📚 Wiki Documentation Added:
- Complete Background Service Guide with architecture diagrams
- Configuration examples and best practices
- Performance benefits and troubleshooting guide
- Migration guide and advanced features

🔧 Navigation Updates:
- Added to sidebar under Technical section
- Updated home page with performance section
- Highlighted as NEW feature with  icon

The wiki now includes comprehensive documentation for the new
background threading system that improves performance across
all sport managers.

* Fix CacheManager constructor in test script

🐛 Bug Fix:
- Fixed CacheManager initialization in test_background_service.py
- CacheManager no longer takes config_manager parameter
- Updated constructor call to match current implementation

 Result:
- Test script now works with current CacheManager API
- Background service testing can proceed without errors

* Move test_background_service.py to test/ directory

📁 Organization Improvement:
- Moved test_background_service.py from root to test/ directory
- Updated import paths to work from new location
- Fixed sys.path to correctly reference src/ directory
- Updated imports to use relative paths

🔧 Technical Changes:
- Changed sys.path from 'src' to '../src' (go up from test/)
- Updated imports to remove 'src.' prefix
- Maintains all functionality while improving project structure

 Benefits:
- Better project organization
- Test files properly grouped in test/ directory
- Cleaner root directory structure
- Follows standard Python project layout

* Remove old test_background_service.py from root directory

📁 Cleanup:
- Removed test_background_service.py from root directory
- File has been moved to test/ directory for better organization
- Maintains clean project structure

* Fix NCAA FB team ranking display functionality

- Add missing _fetch_team_rankings() calls to all update methods (live, recent, upcoming)
- Add ranking display logic to live manager scorebug layout
- Remove unused old _fetch_rankings() method and top_25_rankings variable
- Rankings now properly display as #X format when show_ranking is enabled
- Fixes non-functional ranking feature despite existing UI and configuration options
2025-09-17 17:25:01 -04:00
Chuck
6fcc93cab8 Fix ncaafb ranking display (#45)
* Fix NCAAFB ranking display issue

- Remove duplicate ranking system that was drawing rankings behind team logos
- Old system (_get_rank) was drawing rankings at top of logos
- New system (_fetch_team_rankings) correctly draws rankings in bottom corners
- Remove old ranking calls from live, recent, and upcoming game drawing functions
- Remove unnecessary _fetch_rankings() calls from update methods
- Rankings now only appear in designated corner positions, not overlapping logos

Fixes issue where team rankings/betting lines were being drawn behind
team logos instead of replacing team records in the corners.

* Add missing show_ranking and show_records options to NCAAFB web UI

- Add show_ranking option to NCAAFB scoreboard config template
- Add show_records and show_ranking toggle switches to NCAAFB web UI
- Update JavaScript form collection to include new fields
- Users can now control whether to show team records or rankings via web interface

This completes the fix for NCAAFB ranking display - users can now enable
show_ranking in the web UI to see AP Top 25 rankings instead of team records.
2025-09-17 14:46:57 -04:00
Chuck
379e2c3714 Merge development branch with recovered PRs and latest improvements
- All missing PRs (#15, #17, #35, #36) are now in both main and development
- Latest development improvements merged to main
- Resolved conflicts by keeping development branch merged content
2025-09-17 10:01:05 -04:00
Chuck
3cbb32fec6 Merge missing PRs from main: NCAA Hockey (#36), Emulator Support (#35), NCAA FB AP rankings (#17), NCAA FB logos (#15)
- Added NCAA Hockey support with new manager and logos
- Added emulator support with requirements file
- Added NCAA FB AP top 25 rankings functionality
- Added NCAA FB logo download capability
- Resolved conflicts by keeping development branch improvements while adding missing features
2025-09-17 10:00:27 -04:00
Chuck
29ead0f7d9 renamed ncaa_fbs_logos to ncaa_logos per previous pull request for ncaa hockey, introduced broken managers elsewhere 2025-09-16 22:54:55 -04:00
Chuck
7022a5c572 re-introduce 6 pixel shift, but static instead of dynamic 2025-09-16 22:48:29 -04:00
Chuck
7ba7d5de13 reduce font shift in music manager fo r more consistent experience 2025-09-16 22:42:58 -04:00
Chuck
007006feb2 team record logic update 2025-09-16 22:39:42 -04:00
Chuck
b4b21604da record font debugging 2025-09-16 20:26:00 -04:00
Chuck
688b09b95e adjust ranking logic for ncaa FFB upcoming and recent 2025-09-16 18:31:04 -04:00
Chuck
e894c40ff4 Merge development into main
- Resolved conflicts in src/logo_downloader.py:
  - Combined NCAA hockey endpoint with soccer league endpoints
  - Updated directory mappings to use ncaa_logos for NCAA sports
  - Added support for multiple soccer leagues (Premier League, La Liga, etc.)

- Resolved conflicts in src/ncaa_fb_managers.py:
  - Combined immediate fetch approach with background fetch strategy
  - Maintained both immediate response and comprehensive data fetching
  - Preserved caching functionality for improved performance

- Includes all development branch features:
  - Soccer league support with team logos
  - Enhanced NCAA football data fetching
  - Improved logo downloader with multiple league support
  - Updated wiki documentation and configuration
2025-09-16 15:37:59 -04:00
Chuck
a23a749c59 Update wiki submodule reference
- Updated LEDMatrix.wiki to latest commit (d85658a)
- Includes major wiki reorganization and documentation updates
2025-09-16 15:36:06 -04:00
Chuck
2d8f1b60a3 wiki changes 2025-09-16 14:40:36 -04:00
Chuck
8c03e65104 wiki page about team abbreviations 2025-09-16 14:33:49 -04:00
Chuck
764d80e818 added more missing soccer logos 2025-09-16 14:31:31 -04:00
Chuck
854c236a60 added portuguese soccer league to documentation for soccer manager and added auto-download missing logos for soccer teams 2025-09-16 14:25:47 -04:00
Chuck
4b1b343a8f shift album font down 2 pixels 2025-09-16 14:13:23 -04:00
Chuck
65f04bff63 adjust music manager album text location 2025-09-16 14:11:39 -04:00
Chuck
8055856137 shift of the day description and subtitle down in more situations 2025-09-16 14:09:27 -04:00
Chuck
17a79976dd shift of the day description down one more pixel for total of 4 2025-09-16 14:06:59 -04:00
Chuck
38062d0bee shift album and artist font down 2025-09-16 14:06:14 -04:00
Chuck
2ce252059e shift of the day description down one more pixel 2025-09-16 12:37:21 -04:00
Chuck
c7ee946871 shift music album and artist font down the height of the text font 2025-09-16 12:34:43 -04:00
Chuck
3afcbb759c add freetype error handling 2025-09-16 12:22:54 -04:00
Chuck
bc18202736 shift of the day underline up one pixel 2025-09-16 12:21:17 -04:00
Chuck
a0973a2ad8 shift whole display down 8 pixels 2025-09-16 12:19:50 -04:00
Chuck
c18ab3f91f dialing of the day text spacing - revert back to too much spacing 2025-09-16 12:18:56 -04:00
Chuck
9718595017 dialing of the day text spacing 2025-09-16 12:16:36 -04:00
Chuck
5f803f346b dialing of the day text spacing 2025-09-16 12:13:47 -04:00
Chuck
0320830725 of the day manager text refactor 2025-09-16 12:10:10 -04:00
Chuck
9dd744254a of the day manager text positioning placement fix 2025-09-16 12:03:46 -04:00
Chuck
67b6a6fd68 adjust spacing on of the day manager text 2025-09-16 11:07:06 -04:00
Chuck
ca62fd714f Make sure sports displays are properly processing number of recent games to show 2025-09-16 10:55:07 -04:00
Chuck
49346f9a6d change of the day file path detection 2025-09-15 18:33:27 -04:00
Chuck
9200c9cab3 update logic on all sports displays that upcoming and recent games to show are based on each team, not just the first X # of games found 2025-09-15 18:28:40 -04:00
Chuck
dbdb730b4d fix upcoming game logic for NFL display too 2025-09-15 18:23:58 -04:00
Chuck
91211d5c86 fix upcoming game logic 2025-09-15 18:22:25 -04:00
Chuck
d78c592d6a NCAA FB season now downloads in full but it slows down the display significantly, data fetch has been moved to the background and deferred during scrolling displays 2025-09-15 18:12:54 -04:00
Chuck
4771ec8b3b add black buffer behind odds ticker to finish scroll 2025-09-15 18:09:28 -04:00
Chuck
60f68ff2a3 add permission handling of the day to first time install script 2025-09-15 17:51:20 -04:00
Chuck
c7634cbf3a NCAA FB odds fix 2025-09-15 16:00:14 -04:00
Chuck
96cd383436 NCAA FB logging to figure out why recent and upcoming games aren't loading well 2025-09-15 15:41:37 -04:00
Chuck
e39dd1e0a3 NCAA FB logging 2025-09-15 15:36:04 -04:00
Chuck
7b1339631c of the day try block fix 2025-09-15 15:27:57 -04:00
Chuck
0579b3b860 more of the day debug logging and fix datetime duplicate in NCAA FB 2025-09-15 15:26:11 -04:00
Chuck
e7e76eea4c more robust NCAA FB manager upcoming game check 2025-09-15 15:22:03 -04:00
Chuck
3f431a54d4 path resolution for of the day manager 2025-09-15 15:16:54 -04:00
Chuck
d0f8785936 troubleshooting of the day manager 2025-09-15 15:06:07 -04:00
Chuck
7618eafaa6 troubleshooting of the day manager 2025-09-15 14:53:26 -04:00
Chuck
f8f4539015 hopefully fix of the day settings 2025-09-15 14:38:42 -04:00
Chuck
0ab978d543 web ui config setting accuracy changes 2025-09-15 14:29:14 -04:00
Chuck
c4a51d0f80 espn api update for NCAAFB 2025-09-15 14:21:09 -04:00
Chuck
b20c3880b2 make sure web ui is pulling existing config options 2025-09-15 13:59:33 -04:00
Chuck
652461a819 ensure leaderboard is in webui 2025-09-15 13:20:20 -04:00
Chuck
691d39675d web ui bug fixes 2025-09-15 11:57:52 -04:00
Chuck
9bc0cd5629 moving away from dict errors 2025-09-15 11:48:10 -04:00
Chuck
625a501da5 further dict wrapper update 2025-09-15 11:43:47 -04:00
Chuck
28c2dcd2f7 fix dict class for web ui 2025-09-15 11:40:29 -04:00
Chuck
c55511c099 webui changes to launch after config file changes 2025-09-15 11:34:40 -04:00
Chuck
b96f1e3957 make sure web ui save buttons work 2025-09-15 10:50:55 -04:00
Chuck
fcbc67464d persistent config file via config.template.json and migrate_config.sh 2025-09-15 10:27:16 -04:00
Chuck
4b36937a55 Update sports league logos 2025-09-15 09:17:01 -04:00
Chuck
8ead8ad893 Fix NCAA Football recent games to show truly recent games (last 14 days) instead of entire season
- Add date-based filtering to NCAAFBRecentManager
- Only consider games from last 14 days as 'recent'
- Prevents Week 1 games from showing when user wants yesterday's games
- Fixes issue where recent_games_to_show: 1 would show old games instead of most recent
2025-09-15 08:50:28 -04:00
Alex Resnick
515ae2c7e9 Add NCAA Hockey (#36)
* Add emulator

* Update limit for ESPM API

* use params

* Add NCAA Mens Hockey  Manager

* Add NCAA Hockey to leader board

* update logos

---------

Co-authored-by: Alex Resnick <adr8282@gmail.com>
2025-09-14 18:08:32 -04:00
Alex Resnick
a5a9398c5c Add Emulator Support (#35)
* Add emulator

* Update limit for ESPM API

* use params

---------

Co-authored-by: Alex Resnick <adr8282@gmail.com>
2025-09-14 16:44:50 -04:00
Scott Raynor
b82e904cb1 Add ability to download NCAA FB AP top 25 rankings from ESPN API and display when applicable. (#17)
Signed-off-by: J. Scott Raynor <sr-github@raynorsplace.net>
2025-09-14 16:40:38 -04:00
Chuck
fbff65fbad fix NCAA FB Quarter logic. Fix -1th and 10 status text when negative yards are received 2025-09-14 16:32:10 -04:00
Chuck
19edd9ace0 Merge development branch into main - resolved conflict in ncaa_fb_managers.py 2025-09-12 19:21:28 -04:00
Chuck
0982ef78dd clean config 2025-09-12 19:18:20 -04:00
Chuck
5695d8e017 minor fixes 2025-09-12 19:09:43 -04:00
Chuck
06ad446925 update stock call method 2025-09-12 18:57:39 -04:00
Chuck
6b5a9cdff7 disable calendar for test 2025-09-12 18:56:05 -04:00
Chuck
efb66118e4 full test of most display modes 2025-09-12 18:53:38 -04:00
Chuck
2444aa2fc9 manual buffer on odds ticker to finish the scroll 2025-09-12 18:52:27 -04:00
Chuck
93f6173efa apply leaderboard duration logic to odds manager 2025-09-12 18:49:33 -04:00
Chuck
dc81d48ab1 new TAANDM logo 2025-09-12 18:46:34 -04:00
Chuck
5c32be929e shorten buffer for one perfect loop 2025-09-12 18:43:15 -04:00
Chuck
105f60f57e disable odds 2025-09-12 18:40:00 -04:00
Chuck
a52130cedb brute forcing math for scroll speed 2025-09-12 18:39:31 -04:00
Chuck
d08e7953f2 improve math on dynamic duration for leaderboard 2025-09-12 18:34:35 -04:00
Chuck
d7544b04dd add rankings to odds ticker team names 2025-09-12 18:32:33 -04:00
Chuck
0291540df4 update width calculation for leaderboard duration. Reduce log spam 2025-09-12 18:27:52 -04:00
Chuck
27b9b0267b current x postion tracking update for leaderboard 2025-09-12 18:21:10 -04:00
Chuck
cffef0d161 leaderboard debugging 2025-09-12 18:14:37 -04:00
Chuck
b5cb71b68d enable loop for scrolling dynamic displays 2025-09-12 18:12:02 -04:00
Chuck
7685586508 web ui updates for leaderboard and odds manager timeout if APi call limit is hit 2025-09-12 18:08:46 -04:00
Chuck
b8aaa56b4b Add NCAA football logo download script and update team abbreviations
- Added download_espn_ncaa_fb_logos.py script to download logos from ESPN API
- Downloaded 50 NCAA football team logos to test/ncaaFBlogos/
- Updated all_team_abbreviations.txt with current ESPN team data
- Updated various team logo files (MLB, NBA, NFL, NHL, NCAAF)
2025-09-12 18:01:43 -04:00
Chuck
4aa307c8dd dynamic duration buffer adjustment 2025-09-12 17:57:06 -04:00
Chuck
12b99024a4 leaderboard spacing update 2025-09-12 17:54:40 -04:00
Chuck
22f0e29315 leaderboard spacing calculation update 2025-09-12 17:45:52 -04:00
Chuck
6eeba92350 disable dynamic duration leaderboard 2025-09-12 17:40:52 -04:00
Chuck
286ba2b044 disable loop 2025-09-12 17:39:20 -04:00
Chuck
4b5a1e41d8 update font for leaderboard 2025-09-12 17:34:33 -04:00
Chuck
008705b75c re-enable two leagues for leaderboard 2025-09-12 17:29:51 -04:00
Chuck
5937f968ef change duration buffer on odds ticker 2025-09-12 17:28:11 -04:00
Chuck
4fe5547bf8 test with just one league for leaderboard 2025-09-12 17:25:25 -04:00
Chuck
96f6749516 change width draw logic in leaderboard display 2025-09-12 17:21:20 -04:00
Chuck
bc3883df14 config manager reductions to reduce overhead 2025-09-12 17:15:45 -04:00
Chuck
32b1b8020a specific leaderboard logging 2025-09-12 15:39:20 -04:00
Chuck
9280295ed3 leaderboard debugging 2025-09-12 15:19:03 -04:00
Chuck
e5a29d4668 dynamic duration for odds ticker has larger buffer 2025-09-12 15:15:22 -04:00
Chuck
4cfaa5ca59 reduce logging for leaderboard dynamic duration 2025-09-12 15:13:13 -04:00
Chuck
6f894a587b league data key added to leaderboard image calculation 2025-09-12 15:10:17 -04:00
Chuck
35eb9cbdb5 better handling for png transparency in broadcast logos 2025-09-12 15:08:22 -04:00
Chuck
2d41c5ca31 leaderboard improvements and timing update 2025-09-12 15:06:08 -04:00
Chuck
14f7a8b502 improce caching for leaderboard 2025-09-12 15:02:33 -04:00
Chuck
5101795cbf handle special characters in team names (TA&M A&M) 2025-09-12 14:55:18 -04:00
Chuck
6d0632acee logo downloader for FCS teams is more robust 2025-09-12 14:50:19 -04:00
Chuck
9298eff554 smoother leaderboard scrolling 2025-09-12 13:37:19 -04:00
Chuck
335ab8cce0 update leaderboard data sources for other sports and font sizes 2025-09-12 13:35:01 -04:00
Chuck
32daced427 update logic on odds ticker dynamic duration 2025-09-12 12:10:50 -04:00
Chuck
153edcc2e1 update record & rank logic, update leaderboard font and logo sizes 2025-09-12 12:08:46 -04:00
Chuck
548bc00e00 use correct AP Poll top 25 for NCAAFB 2025-09-12 11:50:51 -04:00
Chuck
f8ab022da9 add dynamic duration to leaderboard 2025-09-10 22:54:24 -04:00
Chuck
cd80745dcb update height references 2025-09-10 22:32:25 -04:00
Chuck
56dfbda40a update leaderboard layout 2025-09-10 22:12:33 -04:00
Chuck
591555c3c7 make sure leaderboard is scrolling horizontally to show all teams 2025-09-10 21:56:29 -04:00
Chuck
bbabad3135 adjustment on leaderboard 2025-09-10 21:28:30 -04:00
Chuck
3329822a46 update tnt logo 2025-09-10 18:21:03 -04:00
Chuck
413a1fa38c update cbs logo 2025-09-10 18:19:11 -04:00
Chuck
3ee7821353 update some broadcast logos and fix multiple stacked panels logic 2025-09-10 18:13:42 -04:00
Chuck
20a816f3e6 update sports logo 2025-09-10 17:01:05 -04:00
Chuck
457f9f9eb5 better error handling and correct image call for top 25 2025-09-10 16:45:34 -04:00
Chuck
39519dbfff enable leaderboard for testing 2025-09-10 13:20:15 -04:00
Chuck
61a56560f3 adjust odds manager mlb spacing 2025-09-10 13:19:45 -04:00
Chuck
c1ccd6f44a fix leaderboard manager import 2025-09-10 13:16:42 -04:00
Chuck
2123f78dad adjust spacing in Odds Manager ticker when Baseball is live, to reduce space between graphic and gameplay stats 2025-09-10 13:12:57 -04:00
Chuck
a1914980c8 Update issue templates 2025-09-04 23:03:10 -04:00
ChuckBuilds
a3dbc6a4a8 standardize config init across displays 2025-09-04 22:24:02 -04:00
ChuckBuilds
8a0fdb005d update UTC timezone logic to check config settings for all managers 2025-09-04 22:18:01 -04:00
Scott Raynor
f13ad238eb Add ability to try to download NCAA football logos not found in the assets folder from the ESPN API. (#15)
Co-authored-by: J. Scott Raynor <jsraynor@gmail.com>
2025-09-01 13:33:35 -04:00
ChuckBuilds
92071237c1 listing all missing team logos 2025-08-19 17:40:09 -05:00
ChuckBuilds
52c2d61dcf Fix odds ticker black display issue when returning to rotation
- Reset display start time when force_clear is True or when starting fresh
- Reset scroll position for clean start when display is reset
- Add check for old display start time and reset if it's more than 2x dynamic duration
- Prevents the odds ticker from staying black when it comes back into rotation
- Ensures proper state management between display sessions
2025-08-18 21:50:38 -05:00
ChuckBuilds
73036c33cb Reduce spacing around bases diamond for tighter layout
- Moved bases to right edge of odds column to be closer to inning indicator
- Reduced horizontal spacing from 10px to 8px between bases
- Reduced vertical spacing from 8px to 6px for more compact diamond
- Updated cluster width from 26px to 24px to match tighter spacing
- Adjusted positioning offset from 13px to 12px for proper centering
- Bases now positioned closer to the inning indicator for better visual flow
2025-08-18 21:46:57 -05:00
ChuckBuilds
d6eb7a778c Update odds ticker bases to match MLB manager style
- Changed from circular bases to diamond-shaped bases (polygons)
- Increased base size from 6px to 8px to match MLB manager
- Increased spacing from 8px to 10px for better visibility
- Added proper cluster positioning and sizing calculations
- Shifted bases down 2 pixels from center for better positioning
- Increased minimum width to 30px to accommodate larger base cluster
- Now uses same diamond-shaped base style as MLB manager for consistency
2025-08-18 21:41:14 -05:00
ChuckBuilds
62b50cc06f fix display start time on odds ticker and added amazon prime video logo to broadcast 2025-08-18 21:35:54 -05:00
ChuckBuilds
05bee6ce84 Replace odds text section with centered graphical bases for baseball
- Removed text-based odds display for baseball live games entirely
- Graphical bases now replace the entire odds section (not just overlay it)
- Bases are properly centered vertically on the display (height // 2)
- Bases are centered horizontally within the odds column width
- Creates cleaner, more focused display with bases as the main visual element
2025-08-18 21:31:58 -05:00
ChuckBuilds
2c2d24c0a8 Fix missing datetime variables for baseball live games
- Added back day_text, date_text, and time_text variables for baseball live games
- These variables are needed for the datetime display section
- Shows inning (▲5), count (2-1), and outs (2 outs) in the datetime column
- Fixes the 'cannot access local variable' error that was occurring
2025-08-18 21:01:39 -05:00
ChuckBuilds
b252229e03 adjust live bases on the odds ticker 2025-08-18 20:55:50 -05:00
ChuckBuilds
8f7aeee546 Fix graphical base positioning and remove old text display
- Removed old text-based bases display code that was still showing
- Fixed positioning calculation for graphical bases to center properly
- Added bounds checking to prevent bases from overlapping off display
- Bases are now properly centered in the odds column with appropriate spacing
- Cleaned up baseball live game display to show only count, outs, and graphical bases
2025-08-18 20:44:48 -05:00
ChuckBuilds
b7fa2f1df6 Add graphical base indicators to odds ticker for baseball live games
- Added _draw_base_indicators() method similar to MLB manager
- Replaced text-based bases display with graphical diamond representation
- Shows diamond outline with filled circles for occupied bases
- Displays count and outs as text while showing bases graphically
- Creates more visual and intuitive representation of game state
- Uses smaller size (6px) and spacing (8px) appropriate for odds ticker
2025-08-18 19:54:13 -05:00
ChuckBuilds
ba3b79dd72 adjust spacing on live game scores 2025-08-18 19:48:14 -05:00
ChuckBuilds
e4e058ff97 Fix outs pluralization in odds ticker live baseball games
- Changed outs display to use proper pluralization:
  - '1 out' for single out
  - '2 outs', '3 outs' for multiple outs
- This makes the live game information more grammatically correct and readable
2025-08-18 19:47:23 -05:00
ChuckBuilds
0b42cec902 Fix odds ticker mid-scroll cutoff issue
- Modified calculate_dynamic_duration() to add extra buffer time when looping is enabled
- Added 20% extra buffer for looping to ensure smooth transitions
- Added logic to detect when display is ending and reset scroll position for clean transitions
- Added display start time tracking to manage duration properly
- This prevents the odds ticker from cutting off mid-scroll when switching modes
2025-08-18 19:46:20 -05:00
ChuckBuilds
35ad842ba1 adjust spacing on live odds outs 2025-08-18 19:43:27 -05:00
ChuckBuilds
08cf4152f7 Improve odds ticker live game display formatting
- Removed parentheses around scores for live games (e.g., 'Team 5' instead of 'Team (5)')
- Improved bases section for baseball games:
  - Changed from '1', '2', '3' to '1B', '2B', '3B' for clarity
  - Changed from '---' to 'Empty' when no bases are occupied
  - This makes it much clearer what the information represents
- Live games now show cleaner, more readable score format
2025-08-18 19:42:30 -05:00
ChuckBuilds
71a392737e Add comprehensive debug logging for odds ticker dynamic duration
- Added debug logging to _fetch_upcoming_games() to track data fetching
- Added debug logging to _create_ticker_image() to track image creation
- Added logging for favorite teams, odds filtering, and game counts
- Added logging for total_scroll_width calculation
- This will help identify why dynamic duration is falling back to minimum
2025-08-18 19:26:12 -05:00
ChuckBuilds
2b93eafcdf improve odds ticker dynamic duration 2025-08-18 19:23:20 -05:00
ChuckBuilds
3c1706d4e8 Fix odds ticker dynamic duration timing issue
- Modified get_dynamic_duration() to trigger update when total_scroll_width is 0
- This ensures the dynamic duration is calculated with actual data before being used
- Prevents fallback to minimum duration (30s) when odds ticker hasn't updated yet
- Added debug logging to track when updates are triggered for duration calculation
2025-08-18 19:13:54 -05:00
ChuckBuilds
e4b3adb867 Fix test script to handle missing game data keys
- Added safe key access using .get() method with defaults
- Added display of available keys in game data for debugging
- Added sport field display to help identify data structure
- This prevents KeyError when game data structure changes
2025-08-18 19:09:50 -05:00
ChuckBuilds
9f00124fad Fix odds ticker dynamic duration calculation
- Fixed double-counting of display width in total_scroll_width calculation
- Added detailed debug logging for dynamic duration calculation
- Added debug logging for scrolling behavior and loop resets
- Created test script for debugging dynamic duration issues
- The issue was that total_scroll_width included display width, causing
  incorrect duration calculations that resulted in early cutoff
2025-08-18 19:05:36 -05:00
ChuckBuilds
68416d0293 live games in odds ticker 2025-08-18 15:50:23 -05:00
ChuckBuilds
e63198dc49 scroll priority to determine data refreshes 2025-08-18 15:21:39 -05:00
ChuckBuilds
a5ce721733 improve filtering on show_favorite_teams_only 2025-08-15 10:14:33 -05:00
ChuckBuilds
e3b65588a2 support older versions of python not having the Union import 2025-08-15 09:38:23 -05:00
ChuckBuilds
f13e9306c9 more fallback errors for milb fonts 2025-08-14 16:46:48 -05:00
ChuckBuilds
ef82610a06 milb font error handling 2025-08-14 13:39:48 -05:00
ChuckBuilds
18145edbf1 default games to show 1 2025-08-14 13:02:23 -05:00
ChuckBuilds
54635fee3c ensure game rotation count respects user defined variable 2025-08-14 13:01:23 -05:00
ChuckBuilds
6152969340 fix favorite team toggle logic being skipped 2025-08-14 12:26:57 -05:00
Chuck
8770e5a327 update readme to use install script 2025-08-13 21:59:16 -05:00
Chuck
822d9909ed apply fix to mlb 2025-08-13 21:49:19 -05:00
Chuck
d179700c6c Removed the problematic os.path.dirname(os.path.abspath(__file__)) pattern 2025-08-13 21:35:53 -05:00
Chuck
dfecc6f8a0 loading fonts va absolute paths 2025-08-13 21:23:37 -05:00
Chuck
0d8d4084a9 overzealous with the font change, rolling some back 2025-08-13 20:54:16 -05:00
Chuck
6bc1039ed6 change how font is loaded via systemctl - added direct paths 2025-08-13 20:36:23 -05:00
Chuck
8e1b04550b allow werkzeug to work in our environment 2025-08-13 17:32:08 -05:00
Chuck
33e1f05f77 update first time install script 2025-08-13 17:15:24 -05:00
Chuck
c4113367f7 default config set 2025-08-13 15:46:20 -05:00
Chuck
4b906b3a92 remove autostart of dsiplay from autostart of web ui 2025-08-13 14:59:49 -05:00
Chuck
06d8360922 web autostart troubleshooting 2025-08-13 14:45:56 -05:00
Chuck
9d4082665a graceful font fallback 2025-08-13 12:53:11 -05:00
Chuck
a3481f3674 permission handling in first time install script 2025-08-13 12:13:41 -05:00
Chuck
e36d92340e more robust first time install script, ensure it creates config_secrets 2025-08-13 11:36:59 -05:00
Chuck
6225189b3c more robust font loading for OTD manager 2025-08-13 10:23:43 -05:00
Chuck
6c658c23c4 disable google calendar by default 2025-08-13 09:52:53 -05:00
Chuck
30cf8ee2e8 make the first time install script more inclusive of user actions 2025-08-12 17:42:22 -05:00
441 changed files with 24721 additions and 15584 deletions

View File

@@ -0,0 +1,38 @@
---
globs: *.py
---
# Python Coding Standards
## Code Quality Principles
- **Simplicity First**: Prefer clear, readable code over clever optimizations
- **Explicit over Implicit**: Make intentions clear through naming and structure
- **Fail Fast**: Validate inputs and handle errors early
- **Documentation**: Use docstrings for classes and complex functions
## Naming Conventions
- **Classes**: PascalCase (e.g., `NHLRecentManager`)
- **Functions/Variables**: snake_case (e.g., `fetch_game_data`)
- **Constants**: UPPER_SNAKE_CASE (e.g., `ESPN_NHL_SCOREBOARD_URL`)
- **Private methods**: Leading underscore (e.g., `_fetch_data`)
## Error Handling
- **Logging**: Use structured logging with context (e.g., `[NHL Recent]`)
- **Exceptions**: Catch specific exceptions, not bare `except:`
- **User-friendly messages**: Explain what went wrong and potential solutions
- **Graceful degradation**: Continue operation when non-critical features fail
## Manager Pattern
All sports managers should follow this structure:
```python
class BaseManager:
def __init__(self, config, display_manager, cache_manager)
def update(self) # Fetch and process data
def display(self, force_clear=False) # Render to display
```
## Configuration Management
- **Type hints**: Use for function parameters and return values
- **Configuration validation**: Check required fields on initialization
- **Default values**: Provide sensible defaults in code, not config
- **Environment awareness**: Handle different deployment contexts

View File

@@ -0,0 +1,42 @@
---
globs: config/*.json,src/*.py
---
# Configuration Management
## Configuration Structure
- **Main config**: [config/config.json](mdc:config/config.json) - Primary configuration
- **Secrets**: [config/config_secrets.json](mdc:config/config_secrets.json) - API keys and sensitive data
- **Templates**: [config/config.template.json](mdc:config/config.template.json) - Default values
## Configuration Principles
- **Validation**: Check required fields and data types on startup
- **Defaults**: Provide sensible defaults in code, not just config
- **Environment awareness**: Handle development vs production differences
- **Security**: Never commit secrets to version control
## Manager Configuration Pattern
```python
def __init__(self, config, display_manager, cache_manager):
self.mode_config = config.get("sport_scoreboard", {})
self.favorite_teams = self.mode_config.get("favorite_teams", [])
self.show_favorite_only = self.mode_config.get("show_favorite_teams_only", False)
```
## Required Configuration Sections
- **Display settings**: Update intervals, display durations
- **API settings**: Timeouts, retry logic, rate limiting
- **Background service**: Threading, caching, priority settings
- **Team preferences**: Favorite teams, filtering options
## Configuration Validation
- **Type checking**: Ensure numeric values are numbers, lists are lists
- **Range validation**: Check that intervals are reasonable
- **Dependency checking**: Verify required services are available
- **Fallback values**: Provide defaults when config is missing or invalid
## Best Practices
- **Documentation**: Comment complex configuration options
- **Examples**: Provide working examples in templates
- **Migration**: Handle configuration changes between versions
- **Testing**: Validate configuration in test environments

View File

@@ -0,0 +1,50 @@
---
globs: src/*.py
---
# Error Handling and Logging
## Logging Standards
- **Structured prefixes**: Use consistent tags like `[NHL Recent]`, `[NFL Live]`
- **Context information**: Include relevant details (team names, game status, dates)
- **Appropriate levels**:
- `info`: Normal operations and status updates
- `debug`: Detailed information for troubleshooting
- `warning`: Non-critical issues that should be noted
- `error`: Problems that need attention
## Error Handling Patterns
```python
try:
data = self._fetch_data()
if not data or 'events' not in data:
self.logger.warning("[Manager] No events found in API response")
return
except requests.exceptions.RequestException as e:
self.logger.error(f"[Manager] API error: {e}")
return None
```
## User-Friendly Messages
- **Explain the situation**: "No games available during off-season"
- **Provide context**: "NHL season typically runs October-June"
- **Suggest solutions**: "Check back when season starts"
- **Distinguish issues**: API problems vs no data vs filtering results
## Graceful Degradation
- **Fallback content**: Show alternative games when favorites unavailable
- **Cached data**: Use cached data when API fails
- **Service continuity**: Continue operation when non-critical features fail
- **Clear communication**: Explain what's happening to users
## Debugging Support
- **Comprehensive logging**: Log API responses, filtering results, display updates
- **State tracking**: Log current state and transitions
- **Performance monitoring**: Track timing and resource usage
- **Error context**: Include stack traces for debugging
## Off-Season Awareness
- **Seasonal messaging**: Different messages for different times of year
- **Helpful context**: Explain why no games are available
- **Future planning**: Mention when season starts
- **Realistic expectations**: Set appropriate expectations during off-season

View File

@@ -0,0 +1,51 @@
---
alwaysApply: true
---
# Git Workflow and Branching
## Branch Naming Conventions
- **Features**: `feature/description-of-feature` (e.g., `feature/weather-forecast-improvements`)
- **Bug fixes**: `fix/description-of-bug` (e.g., `fix/nhl-manager-improvements`)
- **Hotfixes**: `hotfix/critical-issue-description`
- **Refactoring**: `refactor/description-of-refactor`
## Commit Message Format
```
type(scope): description
[optional body]
[optional footer]
```
**Types**: feat, fix, docs, style, refactor, test, chore
**Examples**:
- `feat(nhl): Add enhanced logging for data visibility`
- `fix(display): Resolve rendering performance issue`
- `docs(api): Update ESPN API integration guide`
## Pull Request Guidelines
- **Self-review**: Review your own PR before requesting review
- **Testing**: Test thoroughly on Raspberry Pi hardware
- **Documentation**: Update relevant documentation if needed
- **Clean history**: Squash commits if necessary for clean history
## Code Review Checklist
- **Code Quality**: Proper error handling, logging, type hints
- **Architecture**: Follows project patterns, doesn't break existing functionality
- **Performance**: No negative impact on display performance
- **Testing**: Works on Raspberry Pi hardware
- **Documentation**: Comments added for complex logic
## Merge Strategies
- **Squash and Merge**: Preferred for feature branches and bug fixes
- **Merge Commit**: For complex features with multiple logical commits
- **Rebase and Merge**: For simple, single-commit changes
## Best Practices
- **Keep branches small and focused**
- **Commit frequently with meaningful messages**
- **Update branch regularly with main**
- **Test changes incrementally**
- **Delete feature branches after merge**

View File

@@ -0,0 +1,213 @@
---
description: GitHub branching and pull request best practices for LEDMatrix project
globs: ["**/*.py", "**/*.md", "**/*.json", "**/*.sh"]
alwaysApply: true
---
# GitHub Branching and Pull Request Guidelines
## Branch Naming Conventions
### Feature Branches
- **Format**: `feature/description-of-feature`
- **Examples**:
- `feature/weather-forecast-improvements`
- `feature/stock-api-integration`
- `feature/nba-live-scores`
### Bug Fix Branches
- **Format**: `fix/description-of-bug`
- **Examples**:
- `fix/leaderboard-scrolling-performance`
- `fix/weather-api-timeout`
- `fix/display-rendering-issue`
### Hotfix Branches
- **Format**: `hotfix/critical-issue-description`
- **Examples**:
- `hotfix/display-crash-fix`
- `hotfix/api-rate-limit-fix`
### Refactoring Branches
- **Format**: `refactor/description-of-refactor`
- **Examples**:
- `refactor/sports-manager-architecture`
- `refactor/cache-management-system`
## Branch Management Rules
### Main Branch Protection
- **`main`** branch is protected and requires PR reviews
- Never commit directly to `main`
- All changes must go through pull requests
### Branch Lifecycle
1. **Create** branch from `main` when starting work
2. **Keep** branch up-to-date with `main` regularly
3. **Test** thoroughly before creating PR
4. **Delete** branch after successful merge
### Branch Updates
```bash
# Before starting new work
git checkout main
git pull origin main
# Create new branch
git checkout -b feature/your-feature-name
# Keep branch updated during development
git checkout main
git pull origin main
git checkout feature/your-feature-name
git merge main
```
## Pull Request Guidelines
### PR Title Format
- **Feature**: `feat: Add weather forecast improvements`
- **Fix**: `fix: Resolve leaderboard scrolling performance issue`
- **Refactor**: `refactor: Improve sports manager architecture`
- **Docs**: `docs: Update API integration guide`
- **Test**: `test: Add unit tests for weather manager`
### PR Description Template
```markdown
## Description
Brief description of changes and motivation.
## Type of Change
- [ ] Bug fix (non-breaking change)
- [ ] New feature (non-breaking change)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
- [ ] Performance improvement
- [ ] Refactoring
## Testing
- [ ] Tested on Raspberry Pi hardware
- [ ] Verified display rendering works correctly
- [ ] Checked API integration functionality
- [ ] Tested error handling scenarios
## Screenshots/Videos
(If applicable, add screenshots or videos of the changes)
## Checklist
- [ ] Code follows project style guidelines
- [ ] Self-review completed
- [ ] Comments added for complex logic
- [ ] No hardcoded values or API keys
- [ ] Error handling implemented
- [ ] Logging added where appropriate
```
### PR Review Requirements
#### For Reviewers
- **Code Quality**: Check for proper error handling, logging, and type hints
- **Architecture**: Ensure changes follow project patterns and don't break existing functionality
- **Performance**: Verify changes don't negatively impact display performance
- **Testing**: Confirm changes work on Raspberry Pi hardware
- **Documentation**: Check if documentation needs updates
#### For Authors
- **Self-Review**: Review your own PR before requesting review
- **Testing**: Test thoroughly on Pi hardware before submitting
- **Documentation**: Update relevant documentation if needed
- **Clean History**: Squash commits if necessary for clean history
## Commit Message Guidelines
### Format
```
type(scope): description
[optional body]
[optional footer]
```
### Types
- **feat**: New feature
- **fix**: Bug fix
- **docs**: Documentation changes
- **style**: Code style changes (formatting, etc.)
- **refactor**: Code refactoring
- **test**: Adding or updating tests
- **chore**: Maintenance tasks
### Examples
```
feat(weather): Add hourly forecast display
fix(nba): Resolve live score update issue
docs(api): Update ESPN API integration guide
refactor(sports): Improve base class architecture
```
## Merge Strategies
### Squash and Merge (Preferred)
- Use for feature branches and bug fixes
- Creates clean, linear history
- Combines all commits into single commit
### Merge Commit
- Use for complex features with multiple logical commits
- Preserves commit history
- Use when commit messages are meaningful
### Rebase and Merge
- Use sparingly for simple, single-commit changes
- Creates linear history without merge commits
## Release Management
### Version Tags
- Use semantic versioning: `v1.2.3`
- Tag releases on `main` branch
- Create release notes with technical details
### Release Branches
- **Format**: `release/v1.2.3`
- Use for release preparation
- Include version bumps and final testing
## Emergency Procedures
### Hotfix Process
1. Create `hotfix/` branch from `main`
2. Make minimal fix
3. Test thoroughly
4. Create PR with expedited review
5. Merge to `main` and tag release
6. Cherry-pick to other branches if needed
### Rollback Process
1. Identify last known good commit
2. Create revert PR if possible
3. Use `git revert` for clean rollback
4. Tag rollback release
5. Document issue and resolution
## Best Practices
### Before Creating PR
- [ ] Run all tests locally
- [ ] Test on Raspberry Pi hardware
- [ ] Check for linting errors
- [ ] Update documentation if needed
- [ ] Ensure commit messages are clear
### During Development
- [ ] Keep branches small and focused
- [ ] Commit frequently with meaningful messages
- [ ] Update branch regularly with main
- [ ] Test changes incrementally
### After PR Approval
- [ ] Delete feature branch after merge
- [ ] Update local main branch
- [ ] Verify changes work in production
- [ ] Update any related documentation

View File

@@ -0,0 +1,23 @@
---
alwaysApply: true
---
# LEDMatrix Project Structure
## Core Architecture
- **Main entry point**: [run.py](mdc:run.py) - Primary application launcher
- **Configuration**: [config/config.json](mdc:config/config.json) - Main configuration file
- **Display management**: [src/display_controller.py](mdc:src/display_controller.py) - Core display logic
- **Web interface**: [web_interface_v2.py](mdc:web_interface_v2.py) - Modern web UI
## Source Code Organization
- **Managers**: [src/](mdc:src/) - All sports/weather/stock managers
- **Assets**: [assets/](mdc:assets/) - Logos, fonts, and static resources
- **Tests**: [test/](mdc:test/) - Unit and integration tests
- **Documentation**: [LEDMatrix.wiki/](mdc:LEDMatrix.wiki/) - Comprehensive guides
## Key Design Principles
- **Single Responsibility**: Each manager handles one sport/domain
- **Consistent Patterns**: All managers follow similar structure
- **Configuration-Driven**: Behavior controlled via [config/config.json](mdc:config/config.json)
- **Raspberry Pi Focus**: Optimized for Pi hardware, not Windows development

View File

@@ -0,0 +1,41 @@
---
alwaysApply: true
---
# Raspberry Pi Development Guidelines
## Hardware Constraints
- **Pi-only execution**: Code must run on Raspberry Pi, not Windows development machine
- **LED matrix library**: Uses [rpi-rgb-led-matrix-master/](mdc:rpi-rgb-led-matrix-master/) for hardware control
- **Memory limitations**: Optimize for Pi's limited RAM
- **Performance**: Consider Pi's CPU capabilities in design
## Development Workflow
- **Local development**: Write and test code on Windows
- **Pi deployment**: Deploy and test on actual Pi hardware
- **SSH access**: Use SSH for Pi-based testing and debugging
- **Service management**: Use systemd services for production deployment
## Testing Strategy
- **Unit tests**: Test logic without hardware dependencies
- **Integration tests**: Test with mock display managers
- **Hardware tests**: Validate on actual Pi with LED matrix
- **Performance tests**: Monitor memory and CPU usage
## Deployment Considerations
- **Service files**: [ledmatrix.service](mdc:ledmatrix.service), [ledmatrix-web.service](mdc:ledmatrix-web.service)
- **Installation scripts**: [first_time_install.sh](mdc:first_time_install.sh), [install_service.sh](mdc:install_service.sh)
- **Dependencies**: [requirements.txt](mdc:requirements.txt) for Pi environment
- **Permissions**: Handle file permissions for Pi user
## Performance Optimization
- **Caching**: Use [src/cache_manager.py](mdc:src/cache_manager.py) for data persistence
- **Background services**: Non-blocking data fetching
- **Memory management**: Clean up resources regularly
- **Display optimization**: Minimize unnecessary redraws
## Debugging on Pi
- **Logging**: Comprehensive logging for remote debugging
- **Error reporting**: Clear error messages for troubleshooting
- **Status monitoring**: Health checks and status reporting
- **Remote access**: Web interface for configuration and monitoring

View File

@@ -0,0 +1,42 @@
---
globs: src/*_managers.py
---
# Sports Manager Development
## Manager Architecture
All sports managers inherit from base classes and follow consistent patterns:
- **Base classes**: [src/nhl_managers.py](mdc:src/nhl_managers.py), [src/nfl_managers.py](mdc:src/nfl_managers.py)
- **Common functionality**: Data fetching, caching, display rendering
- **Configuration-driven**: Behavior controlled via config sections
## Required Methods
```python
def __init__(self, config, display_manager, cache_manager)
def update(self) # Fetch fresh data
def display(self, force_clear=False) # Render current data
```
## Data Flow Pattern
1. **Fetch**: Get data from API (with caching)
2. **Process**: Extract relevant game information
3. **Filter**: Apply favorite team preferences
4. **Display**: Render to LED matrix
## Logging Standards
- **Structured prefixes**: `[NHL Recent]`, `[NFL Live]`, etc.
- **Context information**: Include team names, game status, dates
- **Debug levels**: Use appropriate log levels (info, debug, warning, error)
- **User-friendly messages**: Explain what's happening and why
## Error Handling
- **API failures**: Log and continue with cached data if available
- **No data scenarios**: Distinguish between API issues vs no games available
- **Off-season awareness**: Provide helpful context during non-active periods
- **Fallback behavior**: Show alternative content when preferred content unavailable
## Configuration Integration
- **Required settings**: Validate on initialization
- **Optional settings**: Provide sensible defaults
- **Background service**: Use for non-blocking data fetching
- **Caching strategy**: Implement intelligent cache management

View File

@@ -0,0 +1,51 @@
---
globs: test/*.py,src/*.py
---
# Testing Standards
## Test Organization
- **Test directory**: [test/](mdc:test/) - All test files
- **Unit tests**: Test individual components in isolation
- **Integration tests**: Test component interactions
- **Hardware tests**: Validate on Raspberry Pi with actual LED matrix
## Testing Principles
- **Test behavior, not implementation**: Focus on what the code does, not how
- **Mock external dependencies**: Use mocks for APIs, display managers, cache
- **Test edge cases**: Empty data, API failures, configuration errors
- **Pi-specific testing**: Validate hardware integration
## Test Structure
```python
def test_manager_initialization():
"""Test that manager initializes with valid config"""
config = {"sport_scoreboard": {"enabled": True}}
manager = ManagerClass(config, mock_display, mock_cache)
assert manager.enabled == True
def test_api_failure_handling():
"""Test graceful handling of API failures"""
# Test that system continues when API fails
# Verify fallback to cached data
# Check appropriate error logging
```
## Mock Patterns
- **Display Manager**: Mock for testing without hardware
- **Cache Manager**: Mock for testing data persistence
- **API responses**: Mock for consistent test data
- **Configuration**: Use test-specific configs
## Test Categories
- **Unit tests**: Individual manager methods
- **Integration tests**: Manager interactions with services
- **Configuration tests**: Validate config loading and validation
- **Error handling tests**: API failures, invalid data, edge cases
## Testing Best Practices
- **Descriptive names**: Test names should explain what they test
- **Single responsibility**: Each test should verify one thing
- **Independent tests**: Tests should not depend on each other
- **Clean setup/teardown**: Reset state between tests
- **Pi compatibility**: Ensure tests work in Pi environment

38
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.

View File

@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

4
.gitignore vendored
View File

@@ -5,6 +5,8 @@ __pycache__/
# Secrets
config/config_secrets.json
config/config.json
config/config.json.backup
credentials.json
token.pickle
@@ -13,6 +15,7 @@ token.pickle
.venv
env/
venv/
venv*/
ENV/
# IDE
@@ -20,6 +23,7 @@ ENV/
.idea/
*.swp
*.swo
emulator_config.json
# Cache directory
cache/

View File

@@ -0,0 +1,148 @@
# AP Top 25 Dynamic Teams Implementation Summary
## 🎯 Feature Overview
Successfully implemented dynamic team resolution for AP Top 25 rankings in the LEDMatrix project. Users can now add `"AP_TOP_25"` to their `favorite_teams` list and it will automatically resolve to the current AP Top 25 teams, updating weekly as rankings change.
## 🚀 What Was Implemented
### 1. Dynamic Team Resolver (`src/dynamic_team_resolver.py`)
- **Core Functionality**: Resolves dynamic team names like `"AP_TOP_25"` into actual team abbreviations
- **API Integration**: Fetches current AP Top 25 rankings from ESPN API
- **Caching**: 1-hour cache to reduce API calls and improve performance
- **Error Handling**: Graceful fallback when rankings unavailable
- **Multiple Patterns**: Supports `AP_TOP_25`, `AP_TOP_10`, `AP_TOP_5`
### 2. Sports Core Integration (`src/base_classes/sports.py`)
- **Automatic Resolution**: Favorite teams are automatically resolved at initialization
- **Seamless Integration**: Works with existing favorite teams system
- **Logging**: Clear logging of dynamic team resolution
- **Backward Compatibility**: Regular team names work exactly as before
### 3. Configuration Updates (`config/config.template.json`)
- **Example Usage**: Added `"AP_TOP_25"` to NCAA FB configuration example
- **Documentation**: Clear examples of how to use dynamic teams
### 4. Comprehensive Testing
- **Unit Tests**: `test/test_dynamic_team_resolver.py` - Core functionality
- **Integration Tests**: `test/test_dynamic_teams_simple.py` - Configuration integration
- **Edge Cases**: Unknown dynamic teams, empty lists, mixed teams
- **Performance**: Caching verification and performance testing
### 5. Documentation (`LEDMatrix.wiki/AP_TOP_25_DYNAMIC_TEAMS.md`)
- **Complete Guide**: How to use the feature
- **Configuration Examples**: Multiple usage scenarios
- **Technical Details**: API integration, caching, performance
- **Troubleshooting**: Common issues and solutions
- **Best Practices**: Recommendations for optimal usage
## 🔧 Technical Implementation
### Dynamic Team Resolution Process
1. **Detection**: Check if team name is in `DYNAMIC_PATTERNS`
2. **API Fetch**: Retrieve current rankings from ESPN API
3. **Resolution**: Convert dynamic name to actual team abbreviations
4. **Caching**: Store results for 1 hour to reduce API calls
5. **Integration**: Seamlessly work with existing favorite teams logic
### Supported Dynamic Teams
| Dynamic Team | Description | Teams Returned |
|-------------|-------------|----------------|
| `"AP_TOP_25"` | Current AP Top 25 | All 25 ranked teams |
| `"AP_TOP_10"` | Current AP Top 10 | Top 10 ranked teams |
| `"AP_TOP_5"` | Current AP Top 5 | Top 5 ranked teams |
### Configuration Examples
#### Basic AP Top 25 Usage
```json
{
"ncaa_fb_scoreboard": {
"enabled": true,
"show_favorite_teams_only": true,
"favorite_teams": ["AP_TOP_25"]
}
}
```
#### Mixed Regular and Dynamic Teams
```json
{
"ncaa_fb_scoreboard": {
"enabled": true,
"show_favorite_teams_only": true,
"favorite_teams": [
"UGA",
"AUB",
"AP_TOP_25"
]
}
}
```
## ✅ Testing Results
### All Tests Passing
- **Core Functionality**: ✅ Dynamic team resolution works correctly
- **API Integration**: ✅ Successfully fetches AP Top 25 from ESPN
- **Caching**: ✅ 1-hour cache reduces API calls significantly
- **Edge Cases**: ✅ Unknown dynamic teams, empty lists handled properly
- **Performance**: ✅ Second call uses cache (0.000s vs 0.062s)
- **Integration**: ✅ Works seamlessly with existing sports managers
### Test Coverage
- **Unit Tests**: 6 test categories, all passing
- **Integration Tests**: Configuration integration verified
- **Edge Cases**: 4 edge case scenarios tested
- **Performance**: Caching and API call optimization verified
## 🎉 Benefits for Users
### Automatic Updates
- **Weekly Updates**: Rankings automatically update when ESPN releases new rankings
- **No Manual Work**: Users don't need to manually update team lists
- **Always Current**: Always shows games for the current top-ranked teams
### Flexible Options
- **Multiple Ranges**: Choose from AP_TOP_5, AP_TOP_10, or AP_TOP_25
- **Mixed Usage**: Combine with regular favorite teams
- **Easy Configuration**: Simple addition to existing config
### Performance Optimized
- **Efficient Caching**: 1-hour cache reduces API calls
- **Background Updates**: Rankings fetched in background
- **Minimal Overhead**: Only fetches when dynamic teams are used
## 🔮 Future Enhancements
The system is designed to be extensible for future dynamic team types:
- `"PLAYOFF_TEAMS"`: Teams in playoff contention
- `"CONFERENCE_LEADERS"`: Conference leaders
- `"HEISMAN_CANDIDATES"`: Teams with Heisman candidates
- `"RIVALRY_GAMES"`: Traditional rivalry matchups
## 📋 Usage Instructions
### For Users
1. **Add to Config**: Add `"AP_TOP_25"` to your `favorite_teams` list
2. **Enable Filtering**: Set `"show_favorite_teams_only": true`
3. **Enjoy**: System automatically shows games for current top 25 teams
### For Developers
1. **Import**: `from src.dynamic_team_resolver import DynamicTeamResolver`
2. **Resolve**: `resolver.resolve_teams(["AP_TOP_25"], 'ncaa_fb')`
3. **Integrate**: Works automatically with existing SportsCore classes
## 🎯 Success Metrics
- **✅ Feature Complete**: All planned functionality implemented
- **✅ Fully Tested**: Comprehensive test suite with 100% pass rate
- **✅ Well Documented**: Complete documentation and examples
- **✅ Performance Optimized**: Efficient caching and API usage
- **✅ User Friendly**: Simple configuration, automatic updates
- **✅ Backward Compatible**: Existing configurations continue to work
## 🚀 Ready for Production
The AP Top 25 Dynamic Teams feature is fully implemented, tested, and ready for production use. Users can now enjoy automatically updating favorite teams that follow the current AP Top 25 rankings without any manual intervention.

View File

@@ -0,0 +1,208 @@
# Background Data Service for LEDMatrix
## Overview
The Background Data Service is a new feature that implements background threading for season data fetching to prevent blocking the main display loop. This significantly improves responsiveness and user experience during data fetching operations.
## Key Benefits
- **Non-blocking**: Season data fetching no longer blocks the main display loop
- **Immediate Response**: Returns cached or partial data immediately while fetching complete data in background
- **Configurable**: Can be enabled/disabled per sport with customizable settings
- **Thread-safe**: Uses proper synchronization for concurrent access
- **Retry Logic**: Automatic retry with exponential backoff for failed requests
- **Progress Tracking**: Comprehensive logging and statistics
## Architecture
### Core Components
1. **BackgroundDataService**: Main service class managing background threads
2. **FetchRequest**: Represents individual fetch operations
3. **FetchResult**: Contains results of fetch operations
4. **Sport Managers**: Updated to use background service
### How It Works
1. **Cache Check**: First checks for cached data and returns immediately if available
2. **Background Fetch**: If no cache, starts background thread to fetch complete season data
3. **Partial Data**: Returns immediate partial data (current/recent games) for quick display
4. **Completion**: Background fetch completes and caches full dataset
5. **Future Requests**: Subsequent requests use cached data for instant response
## Configuration
### NFL Configuration Example
```json
{
"nfl_scoreboard": {
"enabled": true,
"background_service": {
"enabled": true,
"max_workers": 3,
"request_timeout": 30,
"max_retries": 3,
"priority": 2
}
}
}
```
### Configuration Options
- **enabled**: Enable/disable background service (default: true)
- **max_workers**: Maximum number of background threads (default: 3)
- **request_timeout**: HTTP request timeout in seconds (default: 30)
- **max_retries**: Maximum retry attempts for failed requests (default: 3)
- **priority**: Request priority (higher = more important, default: 2)
## Implementation Status
### Phase 1: Background Season Data Fetching ✅ COMPLETED
- [x] Created BackgroundDataService class
- [x] Implemented thread-safe data caching
- [x] Added retry logic with exponential backoff
- [x] Modified NFL manager to use background service
- [x] Added configuration support
- [x] Created test script
### Phase 2: Rollout to Other Sports (Next Steps)
- [ ] Apply to NCAAFB manager
- [ ] Apply to NBA manager
- [ ] Apply to NHL manager
- [ ] Apply to MLB manager
- [ ] Apply to other sport managers
## Testing
### Test Script
Run the test script to verify background service functionality:
```bash
python test_background_service.py
```
### Test Scenarios
1. **Cache Hit**: Verify immediate return of cached data
2. **Background Fetch**: Verify non-blocking background data fetching
3. **Partial Data**: Verify immediate return of partial data during background fetch
4. **Completion**: Verify background fetch completion and caching
5. **Subsequent Requests**: Verify cache usage for subsequent requests
6. **Service Disabled**: Verify fallback to synchronous fetching
### Expected Results
- Initial fetch should return partial data immediately (< 1 second)
- Background fetch should complete within 10-30 seconds
- Subsequent fetches should use cache (< 0.1 seconds)
- No blocking of main display loop
## Performance Impact
### Before Background Service
- Season data fetch: 10-30 seconds (blocking)
- Display loop: Frozen during fetch
- User experience: Poor responsiveness
### After Background Service
- Initial response: < 1 second (partial data)
- Background fetch: 10-30 seconds (non-blocking)
- Display loop: Continues normally
- User experience: Excellent responsiveness
## Monitoring
### Logs
The service provides comprehensive logging:
```
[NFL] Background service enabled with 3 workers
[NFL] Starting background fetch for 2024 season schedule...
[NFL] Using 15 immediate events while background fetch completes
[NFL] Background fetch completed for 2024: 256 events
```
### Statistics
Access service statistics:
```python
stats = background_service.get_statistics()
print(f"Total requests: {stats['total_requests']}")
print(f"Cache hits: {stats['cached_hits']}")
print(f"Average fetch time: {stats['average_fetch_time']:.2f}s")
```
## Error Handling
### Automatic Retry
- Failed requests are automatically retried with exponential backoff
- Maximum retry attempts are configurable
- Failed requests are logged with error details
### Fallback Behavior
- If background service is disabled, falls back to synchronous fetching
- If background fetch fails, returns partial data if available
- Graceful degradation ensures system continues to function
## Future Enhancements
### Phase 2 Features
- Apply to all sport managers
- Priority-based request queuing
- Dynamic worker scaling
- Request batching for efficiency
### Phase 3 Features
- Real-time data streaming
- WebSocket support for live updates
- Advanced caching strategies
- Performance analytics dashboard
## Troubleshooting
### Common Issues
1. **Background service not starting**
- Check configuration: `background_service.enabled = true`
- Verify cache manager is properly initialized
- Check logs for initialization errors
2. **Slow background fetches**
- Increase `request_timeout` in configuration
- Check network connectivity
- Monitor API rate limits
3. **Memory usage**
- Background service automatically cleans up old requests
- Adjust `max_workers` if needed
- Monitor cache size
### Debug Mode
Enable debug logging for detailed information:
```python
logging.getLogger('src.background_data_service').setLevel(logging.DEBUG)
```
## Contributing
When adding background service support to new sport managers:
1. Import the background service
2. Initialize in `__init__` method
3. Update data fetching method to use background service
4. Add configuration options
5. Test thoroughly
6. Update documentation
## License
This feature is part of the LEDMatrix project and follows the same license terms.

View File

@@ -1,326 +0,0 @@
# LED Matrix Installation Guide
## Quick Start (Recommended for First-Time Installation)
# System Setup & Installation
1. Open PowerShell and ssh into your Raspberry Pi with ledpi@ledpi (or Username@Hostname)
```bash
ssh ledpi@ledpi
```
2. Update repositories, upgrade raspberry pi OS, install git
```bash
sudo apt update && sudo apt upgrade -y
sudo apt install -y git python3-pip cython3 build-essential python3-dev python3-pillow scons
```
3. Clone this repository:
```bash
git clone https://github.com/ChuckBuilds/LEDMatrix.git
cd LEDMatrix
```
4. Install dependencies:
```bash
sudo pip3 install --break-system-packages -r requirements.txt
```
--break-system-packages allows us to install without a virtual environment
5. Install rpi-rgb-led-matrix dependencies:
```bash
cd rpi-rgb-led-matrix-master
```
```bash
sudo make build-python PYTHON=$(which python3)
```
```bash
cd bindings/python
sudo python3 setup.py install
```
Test it with:
```bash
python3 -c 'from rgbmatrix import RGBMatrix, RGBMatrixOptions; print("Success!")'
```
## Important: Sound Module Configuration
1. Remove unnecessary services that might interfere with the LED matrix:
```bash
sudo apt-get remove bluez bluez-firmware pi-bluetooth triggerhappy pigpio
```
2. Blacklist the sound module:
```bash
cat <<EOF | sudo tee /etc/modprobe.d/blacklist-rgb-matrix.conf
blacklist snd_bcm2835
EOF
```
then execute
```bash
sudo update-initramfs -u
```
3. Reboot:
```bash
sudo reboot
```
## Performance Optimization
To reduce flickering and improve display quality:
1. Edit `/boot/firmware/cmdline.txt`:
```bash
sudo nano /boot/firmware/cmdline.txt
```
2. Add `isolcpus=3` at the end of the line
3. Ctrl + X to exit, Y to save, Enter to Confirm
4. Edit /boot/firmware/config.txt with
```bash
sudo nano /boot/firmware/config.txt
```
6. Edit the `dtparam=audio=on` section to `dtparam=audio=off`
7. Ctrl + X to exit, Y to save, Enter to Confirm
8. Save and reboot:
```bash
sudo reboot
```
9. Run the first_time_install.sh with
```
sudo ./first_time_install.sh
```
to ensure all the permissions are correct.
10. Then run
```
sudo python start_web_conditionally.py
```
to start the web ui and download the r
-----------------------------------------------------------------------------------
## Configuration
1.Edit `config/config.json` with your preferences via `sudo nano config/config.json`
###API Keys
For sensitive settings like API keys:
Copy the template: `cp config/config_secrets.template.json config/config_secrets.json`
Edit `config/config_secrets.json` with your API keys via `sudo nano config/config_secrets.json`
Ctrl + X to exit, Y to overwrite, Enter to Confirm
Everything is configured via `config/config.json` and `config/config_secrets.json`.
For a complete first-time installation, run:
```bash
chmod +x first_time_install.sh
```
then
```bash
sudo ./first_time_install.sh
```
This single script handles everything you need for a new installation.
## Individual Scripts Explained
### **First-Time Installation Scripts**
#### `first_time_install.sh` ⭐ **RECOMMENDED**
- **When to use**: New installations only
- **What it does**: Complete setup including all steps below
- **Usage**: `sudo ./first_time_install.sh`
### **Service Installation Scripts**
#### `install_service.sh`
- **When to use**: Install main LED Matrix display service
- **What it does**:
- Creates systemd service for main display
- Creates systemd service for web interface
- Enables services to start on boot
- **Usage**: `sudo ./install_service.sh`
#### `install_web_service.sh`
- **When to use**: Install only the web interface service (legacy)
- **What it does**: Installs the web interface systemd service
- **Usage**: `sudo ./install_web_service.sh`
- **Note**: `install_service.sh` now handles this automatically
### **Permission Fix Scripts**
#### `fix_cache_permissions.sh`
- **When to use**: When you see cache permission errors
- **What it does**:
- Creates cache directories (`/var/cache/ledmatrix`)
- Sets proper permissions for cache access
- Creates placeholder logo directories
- **Usage**: `sudo ./fix_cache_permissions.sh`
#### `fix_web_permissions.sh`
- **When to use**: When web interface can't access logs or system commands
- **What it does**:
- Adds user to `systemd-journal` group (for log access)
- Adds user to `adm` group (for system access)
- Sets proper file ownership
- **Usage**: `./fix_web_permissions.sh` (run as regular user)
#### `configure_web_sudo.sh`
- **When to use**: When web interface buttons don't work (sudo password errors)
- **What it does**:
- Configures passwordless sudo access for web interface
- Allows web interface to start/stop services without password
- **Usage**: `./configure_web_sudo.sh` (run as regular user)
### **Dependency Installation Scripts**
#### `install_dependencies_apt.py`
- **When to use**: When you want to install packages via apt first, then pip
- **What it does**:
- Tries to install packages via apt (system packages)
- Falls back to pip with `--break-system-packages`
- Handles externally managed Python environments
- **Usage**: `sudo python3 install_dependencies_apt.py`
#### `start_web_v2.py`
- **When to use**: Manual web interface startup
- **What it does**:
- Installs dependencies
- Starts web interface directly
- Includes comprehensive logging
- **Usage**: `python3 start_web_v2.py`
#### `run_web_v2.sh`
- **When to use**: Manual web interface startup (shell script version)
- **What it does**: Same as `start_web_v2.py` but as a shell script
- **Usage**: `./run_web_v2.sh`
### **Utility Scripts**
#### `cleanup_venv.sh`
- **When to use**: Remove virtual environment if you don't want to use it
- **What it does**: Removes `venv_web_v2` directory
- **Usage**: `./cleanup_venv.sh`
#### `start_web_conditionally.py`
- **When to use**: Called by systemd service (don't run manually)
- **What it does**:
- Checks config for `web_display_autostart` setting
- Starts web interface only if enabled
- Used by the systemd service
## Installation Scenarios
### **Scenario 1: Brand New Installation**
```bash
# One command does everything
sudo ./first_time_install.sh
```
### **Scenario 2: Adding Web Interface to Existing Installation**
```bash
# Install web interface dependencies
sudo python3 install_dependencies_apt.py
# Fix permissions
./fix_web_permissions.sh
# Configure sudo access
./configure_web_sudo.sh
# Install services
sudo ./install_service.sh
```
### **Scenario 3: Fixing Permission Issues**
```bash
# Fix cache permissions
sudo ./fix_cache_permissions.sh
# Fix web interface permissions
./fix_web_permissions.sh
# Configure sudo access
./configure_web_sudo.sh
# Log out and back in for group changes to take effect
```
### **Scenario 4: Manual Web Interface Startup**
```bash
# Start web interface manually (for testing)
python3 start_web_v2.py
```
## Post-Installation Steps
### **1. Log Out and Log Back In**
After running permission scripts, you need to log out and back in for group changes to take effect:
```bash
# Or use this command to apply group changes immediately
newgrp systemd-journal
```
### **2. Configure the Web Interface**
Edit `config/config.json` and set:
```json
{
"web_display_autostart": true
}
```
### **3. Access the Web Interface**
Open your browser and go to:
```
http://your-pi-ip:5001
```
### **4. Test Everything**
- Check if services are running: `sudo systemctl status ledmatrix.service`
- Check web interface: `sudo systemctl status ledmatrix-web.service`
- View logs: `journalctl -u ledmatrix.service -f`
## Troubleshooting
### **Web Interface Not Accessible**
1. Check if service is running: `sudo systemctl status ledmatrix-web.service`
2. Check logs: `journalctl -u ledmatrix-web.service -f`
3. Ensure `web_display_autostart` is `true` in config
### **Permission Errors**
1. Run: `./fix_web_permissions.sh`
2. Run: `./configure_web_sudo.sh`
3. Log out and back in
### **Cache Permission Errors**
1. Run: `sudo ./fix_cache_permissions.sh`
### **Sudo Password Prompts**
1. Run: `./configure_web_sudo.sh`
2. Log out and back in
### **Dependency Installation Errors**
1. Run: `sudo python3 install_dependencies_apt.py`
## Summary
For **first-time installations**: Use `first_time_install.sh`
For **existing installations with issues**: Use the individual permission and configuration scripts as needed.
The `first_time_install.sh` script is designed to handle everything automatically, so you typically only need to run individual scripts if you're troubleshooting specific issues.

Submodule LEDMatrix.wiki updated: a01c72e156...fbd8d89a18

647
README.md
View File

@@ -25,48 +25,59 @@
- Randomwire @ https://www.thingiverse.com/thing:5169867 for their 4mm Pixel Pitch LED Matrix Stand
-----------------------------------------------------------------------------------
## Core Features
<details>
<summary>Core Features</summary>
## Core Features
Modular, rotating Displays that can be individually enabled or disabled per the user's needs with some configuration around display durations, teams, stocks, weather, timezones, and more. Displays include:
### Time and Weather
- Real-time clock display
- Real-time clock display (2x 64x32 Displays 4mm Pixel Pitch)
![DSC01361](https://github.com/user-attachments/assets/c4487d40-5872-45f5-a553-debf8cea17e9)
- Current Weather, Daily Weather, and Hourly Weather Forecasts
- Current Weather, Daily Weather, and Hourly Weather Forecasts (2x 64x32 Displays 4mm Pixel Pitch)
![DSC01362](https://github.com/user-attachments/assets/d31df736-522f-4f61-9451-29151d69f164)
![DSC01364](https://github.com/user-attachments/assets/eb2d16ad-6b12-49d9-ba41-e39a6a106682)
![DSC01365](https://github.com/user-attachments/assets/f8a23426-e6fa-4774-8c87-19bb94cfbe73)
- Google Calendar event display
- Google Calendar event display (2x 64x32 Displays 4mm Pixel Pitch)
![DSC01374-1](https://github.com/user-attachments/assets/5bc89917-876e-489d-b944-4d60274266e3)
### Sports Information
The system supports live, recent, and upcoming game information for multiple sports leagues:
- NHL (Hockey)
- NHL (Hockey) (2x 64x32 Displays 4mm Pixel Pitch)
![DSC01356](https://github.com/user-attachments/assets/64c359b6-4b99-4dee-aca0-b74debda30e0)
![DSC01339](https://github.com/user-attachments/assets/2ccc52af-b4ed-4c06-a341-581506c02153)
![DSC01337](https://github.com/user-attachments/assets/f4faf678-9f43-4d37-be56-89ecbd09acf6)
- NBA (Basketball)
- MLB (Baseball)
- MLB (Baseball) (2x 64x32 Displays 4mm Pixel Pitch)
![DSC01359](https://github.com/user-attachments/assets/71e985f1-d2c9-4f0e-8ea1-13eaefeec01c)
- NFL (Football)
- NCAA Football
- NFL (Football) (2x 96x48 Displays 2.5mm Pixel Pitch)
<img width="2109" height="541" alt="image" src="https://github.com/user-attachments/assets/d10212c9-0d45-4f87-b61d-0a33afb9f160" />
- NCAA Football (2x 96x48 Displays 2.5mm Pixel Pitch)
<img width="2417" height="610" alt="image" src="https://github.com/user-attachments/assets/9be92869-ee29-4809-9337-69977f228e23" />
- NCAA Men's Basketball
- NCAA Men's Baseball
- Soccer
- Soccer (Premier League, La Liga, Bundesliga, Serie A, Ligue 1, Liga Portugal, Champions League, Europa League, MLS)
- (Note, some of these sports seasons were not active during development and might need fine tuning when games are active)
### Financial Information
- Near real-time stock & crypto price updates
- Stock news headlines
- Customizable stock & crypto watchlists
- Customizable stock & crypto watchlists (2x 64x32 Displays 4mm Pixel Pitch)
![DSC01366](https://github.com/user-attachments/assets/95b67f50-0f69-4479-89d0-1d87c3daefd3)
![DSC01368](https://github.com/user-attachments/assets/c4b75546-388b-4d4a-8b8c-8c5a62f139f9)
@@ -77,45 +88,50 @@ The system supports live, recent, and upcoming game information for multiple spo
- Spotify integration
- YouTube Music integration
- Album art display
- Now playing information with scrolling text
- Now playing information with scrolling text (2x 64x32 Displays 4mm Pixel Pitch)
![DSC01354](https://github.com/user-attachments/assets/7524b149-f55d-4eb7-b6c6-6e336e0d1ac1)
![DSC01389](https://github.com/user-attachments/assets/3f768651-5446-4ff5-9357-129cd8b3900d)
### Custom Display Features
- Custom Text display
- Custom Text display (2x 64x32 Displays 4mm Pixel Pitch)
![DSC01379](https://github.com/user-attachments/assets/338b7578-9d4b-4465-851c-7e6a1d999e07)
- Youtube Subscriber Count Display
- Youtube Subscriber Count Display (2x 64x32 Displays 4mm Pixel Pitch)
![DSC01376](https://github.com/user-attachments/assets/7ea5f42d-afce-422f-aa97-6b2a179aa7d2)
- Font testing Display (not in rotation)
</details>
## System Architecture
The system is built with a modular architecture that allows for easy extension and maintenance:
- `DisplayController`: Main orchestrator managing all display modes
- Individual managers for each feature (sports, weather, music, etc.)
- Separate authentication handlers for different services
- Configurable display modes and rotation patterns from one file - config.json
## Configuration
The system can be configured through a JSON configuration file that allows users to:
- Enable/disable specific features
- Set display durations
- Configure API keys and endpoints
- Customize display modes and rotation patterns
- Set preferred music sources
- Configure sports team preferences
-----------------------------------------------------------------------------------
## Hardware
<details>
<summary>Hardware Requirements</summary>
## Hardware Requirements
- Raspberry Pi 3b or 4 (NOT RPI5!) : Amazon Affiliate Link: Raspberry Pi 4 4GB (https://amzn.to/4dJixuX)
- Adafruit RGB Matrix Bonnet/HAT : https://www.adafruit.com/product/3211
- 2x LED Matrix panels (64x32) (Designed for 128x32 but has a lot of dynamic scaling elements that could work on a variety of displays, pixel pitch is user preference) : https://www.adafruit.com/product/2278
- 5V 4A DC Power Supply for Adafruit RGB HAT : https://www.adafruit.com/product/1466
### Raspberry Pi
- **Raspberry Pi 3B or 4 (NOT RPi 5!)**
[Amazon Affiliate Link Raspberry Pi 4 4GB](https://amzn.to/4dJixuX)
### RGB Matrix Bonnet / HAT
- [Adafruit RGB Matrix Bonnet/HAT](https://www.adafruit.com/product/3211) supports one “chain” of horizontally connected displays
- [Adafruit Triple LED Matrix Bonnet](https://www.adafruit.com/product/6358) supports up to 3 vertical “chains” of horizontally connected displays *(use `regular-pi1` as hardware mapping)*
- [Electrodragon RGB HAT](https://www.electrodragon.com/product/rgb-matrix-panel-drive-board-raspberry-pi/) supports up to 3 vertical “chains”
- [Seengreat Matrix Adapter Board](https://amzn.to/3KsnT3j) single-chain LED Matrix *(use `regular` as hardware mapping)*
### LED Matrix Panels
(2x in a chain recommended)
- [Adafruit 64×32](https://www.adafruit.com/product/2278) designed for 128×32 but works with dynamic scaling on many displays (pixel pitch is user preference)
- [Waveshare 64×32](https://amzn.to/3Kw55jK) - Does not require E addressable pad
- [Waveshare 92×46](https://amzn.to/4pQdezE) higher resolution, requires soldering the **E addressable pad** on the [Adafruit RGB Bonnet](https://www.adafruit.com/product/3211) to “8” **OR** toggling the DIP switch on the Adafruit Triple LED Matrix Bonnet *(no soldering required!)*
> Amazon Affiliate Link ChuckBuilds receives a small commission on purchases
### Power Supply
- [5V 4A DC Power Supply](https://www.adafruit.com/product/658) (good for 2 -3 displays, depending on brightness and pixel density, you'll need higher amperage for more)
- [5V 10AM DC Power Supply](https://amzn.to/3IKlYqe) (good for 6-8 displays, depending on brightness and pixel density)
## Optional but recommended mod for Adafruit RGB Matrix Bonnet
- By soldering a jumper between pins 4 and 18, you can run a specialized command for polling the matrix display. This provides better brightness, less flicker, and better color.
@@ -123,22 +139,69 @@ The system can be configured through a JSON configuration file that allows users
- More information available: https://github.com/hzeller/rpi-rgb-led-matrix/tree/master?tab=readme-ov-file
![DSC00079](https://github.com/user-attachments/assets/4282d07d-dfa2-4546-8422-ff1f3a9c0703)
-----------------------------------------------------------------------------------
## Possibly required depending on the display you are using.
- Some LED Matrix displays require an "E" addressable line to draw the display properly. The [64x32 Adafruit display](https://www.adafruit.com/product/2278) does NOT require the E addressable line, however the [92x46 Waveshare display](https://amzn.to/4pQdezE) DOES require the "E" Addressable line.
- Various ways to enable this depending on your Bonnet / HAT.
Your display will look like it is "sort of" working but still messed up.
<img width="841" height="355" alt="image" src="https://github.com/user-attachments/assets/7b8cfa98-270c-4c41-9cdc-146535eec32f" />
or
<img width="924" height="316" alt="image" src="https://github.com/user-attachments/assets/fda59057-faca-401b-8d55-f0e360cadbdf" />
or
<img width="1363" height="703" alt="image" src="https://github.com/user-attachments/assets/0e833721-1690-4446-a6a9-7c48eed7a633" />
How to set addressable E line on various HATs:
- Adafruit Single Chain HATs
<img width="719" height="958" alt="IMG_5228" src="https://github.com/user-attachments/assets/b30e839c-6fc9-4129-a99c-0f4eaf62c89d" />
or
<img width="349" height="302" alt="image" src="https://github.com/user-attachments/assets/2175fa40-98a8-4da7-bcd3-d6b1714e33d2" />
- Adafruit Triple Chain HAT
![6358-06](https://github.com/user-attachments/assets/f9570fe5-25c6-4340-811a-a3f0d71559a0)
- ElectroDragon RGB LED Matrix Panel Drive Board
![RGB-Matrix-Panel-Drive-Board-For-Raspberry-Pi-02-768x574](https://github.com/user-attachments/assets/6cfe2545-0fc4-49d6-a314-dfdb229258c6)
2 Matrix display with Rpi connected to Adafruit Single Chain HAT.
![DSC00073](https://github.com/user-attachments/assets/a0e167ae-37c6-4db9-b9ce-a2b957ca1a67)
</details>
<details>
<summary>Mount / Stand options</summary>
## Mount/Stand
I 3D printed stands to keep the panels upright and snug. STL Files are included in the Repo but are also available at https://www.thingiverse.com/thing:5169867 Thanks to "Randomwire" for making these for the 4mm Pixel Pitch LED Matrix.
Special Thanks for Rmatze for making:
- 3mm Pixel Pitch RGB Stand for 32x64 Display : https://www.thingiverse.com/thing:7149818
- 4mm Pixel Pitch RGB Stand for 32x64 Display : https://www.thingiverse.com/thing:7165993
These are not required and you can probably rig up something basic with stuff you have around the house. I used these screws: https://amzn.to/4mFwNJp (Amazon Affiliate Link)
-----------------------------------------------------------------------------------
2 Matrix display with Rpi connected.
![DSC00073](https://github.com/user-attachments/assets/a0e167ae-37c6-4db9-b9ce-a2b957ca1a67)
</details>
-----------------------------------------------------------------------------------
## Installation Steps
<details>
<summary>Preparing the Raspberry Pi</summary>
# Preparing the Raspberry Pi
1. Create RPI Image on a Micro-SD card (I use 16gb because I have it, size is not too important but I would use 8gb or more) using [Raspberry Pi Imager](https://www.raspberrypi.com/software/)
2. Choose your Raspberry Pi (3B+ in my case)
3. For Operating System (OS), choose "Other", then choose Raspbian OS Lite (64-bit)
3. For Operating System (OS), choose "Other", then choose Raspbian OS (Legacy, 64-bit) Lite (This needs to be Debian Bookworm not Debian Trixie! Packages are broken on Trixie as of 10/2/25. I will try to get working as soon as requirements are met!)
![image](https://github.com/user-attachments/assets/e8e2e806-18a8-4175-9c25-0cefaae438ea)
4. For Storage, choose your micro-sd card
![image](https://github.com/user-attachments/assets/05580e0a-86d5-4613-aadc-93207365c38f)
5. Press Next then Edit Settings
@@ -148,9 +211,13 @@ These are not required and you can probably rig up something basic with stuff yo
7. Under the Services Tab, make sure that SSH is enabled. I recommend using password authentication for ease of use - it is the password you just chose above.
![image](https://github.com/user-attachments/assets/1d78d872-7bb1-466e-afb6-0ca26288673b)
8. Then Click "Save" and Agree to Overwrite the Micro-SD card.
</details>
-----------------------------------------------------------------------------------
<details>
<summary>System Setup & Installation</summary>
# System Setup & Installation
@@ -171,6 +238,32 @@ git clone https://github.com/ChuckBuilds/LEDMatrix.git
cd LEDMatrix
```
REMOVE ME BEFORE PR:
To use the BETA Plugins branch (things will be broken!) on Rasbian 13 Trixie type:
```bash
git checkout plugins
git pull
```
otherwise continue to the next step for the stable older version (that only works on Rasbian 12!)
4. First-time installation (recommended)
```bash
chmod +x first_time_install.sh
sudo bash ./first_time_install.sh
```
This single script installs services, dependencies, configures permissions and sudoers, and validates the setup.
</details>
<details>
<summary>Outdated Installation Steps left for reference</summary>
-----------------------------------------------------------------------------------
----- OLD STEPS (left for manual review, you don't need to run these if you run the First Time Install Script) -----
4. Install dependencies:
```bash
sudo pip3 install --break-system-packages -r requirements.txt
@@ -245,38 +338,69 @@ sudo nano /boot/firmware/config.txt
```bash
sudo reboot
```
## Configuration
9. Run the first_time_install.sh with
### Initial Setup
1. **First-time setup**: (First Time Script should do this for you) Copy the template to create your config:
```bash
chmod +x first_time_install.sh
cp config/config.template.json config/config.json
```
then
</details>
## Configuration
<details>
<summary>Configuration</summary>
## Configuration
### Initial Setup
The system uses a template-based configuration approach to avoid Git conflicts during updates:
1. **First-time setup**: The previous "First_time_install.sh" script should've already copied the template to create your config.json:
2. **Edit your configuration**:
```bash
sudo nano config/config.json
```
or edit via web interface at http://ledpi:5001
3. **Having Issues?**: Run the First Time Script again:
```bash
sudo ./first_time_install.sh
```
to ensure all the permissions are correct.
-----------------------------------------------------------------------------------
## Configuration
1.Edit `config/config.json` with your preferences via `sudo nano config/config.json`
###API Keys
### API Keys and Secrets
For sensitive settings like API keys:
Copy the template: `cp config/config_secrets.template.json config/config_secrets.json`
Edit `config/config_secrets.json` with your API keys via `sudo nano config/config_secrets.json`
Ctrl + X to exit, Y to overwrite, Enter to Confirm
1. Copy the secrets template: `cp config/config_secrets.template.json config/config_secrets.json`
2. Edit `config/config_secrets.json` with your API keys via `sudo nano config/config_secrets.json`
3. Ctrl + X to exit, Y to overwrite, Enter to Confirm
Everything is configured via `config/config.json` and `config/config_secrets.json`.
### Automatic Configuration Migration
The system automatically handles configuration updates:
- **New installations**: Creates `config.json` from the template automatically
- **Existing installations**: Automatically adds new configuration options with default values when the system starts
- **Backup protection**: Creates a backup of your current config before applying updates
- **No conflicts**: Your custom settings are preserved while new options are added
Everything is configured via `config/config.json` and `config/config_secrets.json`. The `config.json` file is not tracked by Git to prevent conflicts during updates.
</details>
<details>
<summary>Calendar Display Configuration</summary>
-----------------------------------------------------------------------------------
## Calendar Display Configuration
@@ -312,6 +436,11 @@ The calendar display will show:
- Event date and time
- Event title (wrapped to fit the display)
- Up to 3 upcoming events (configurable)
</details>
<details>
<summary>Odds Ticker Configuration</summary>
## Odds Ticker Configuration
@@ -375,7 +504,7 @@ The ticker displays team logos alongside the text:
- `assets/sports/nfl_logos/`
- `assets/sports/nba_logos/`
- `assets/sports/mlb_logos/`
- `assets/sports/ncaa_fbs_logos/`
- `assets/sports/ncaa_logos/`
### Troubleshooting
@@ -407,6 +536,12 @@ This will:
2. Fetch upcoming games and odds
3. Display sample games
4. Test the scrolling functionality
</details>
<details>
<summary>Stocks Configuration</summary>
## Stocks Configuration
@@ -509,6 +644,13 @@ This will:
2. Verify configuration loading
3. Test cache clearing behavior
</details>
<details>
<summary>Football Configuration</summary>
## Football Game-Based Configuration (NFL & NCAA FB)
For NFL and NCAA Football, the system now uses a game-based fetch approach instead of time-based windows. This is more practical for football since games are weekly and you want to show specific numbers of games rather than arbitrary time periods.
@@ -558,6 +700,13 @@ Instead of using `past_fetch_days` and `future_fetch_days`, the system now uses:
- **Off-Season**: `fetch_future_games: 1` shows the first scheduled game (even if it's months away)
- **Planning**: `fetch_future_games: 2` shows the next two matchups for planning purposes
</details>
<details>
<summary> Music Display Configuration </summary>
## Music Display Configuration
The Music Display module shows information about the currently playing track from either Spotify or YouTube Music (via the [YouTube Music Desktop App](https://ytmdesktop.app/) companion server).
@@ -694,105 +843,9 @@ To get these credentials:
* Connection errors: Double-check the `YTM_COMPANION_URL` in `config.json` matches what YTMD's companion server is set to.
* Ensure your firewall (Windows Firewall) allows YTM Desktop app to access local networks.
-----------------------------------------------------------------------------------
### Favorite Team Filtering
Across all sports displays (NFL, MLB, NBA, etc.), you can control which games are shown using the `"show_favorite_teams_only"` and `"favorite_teams"` settings in your `config/config.json`.
</details>
**How it Works:**
* **`"show_favorite_teams_only": true`**: When this is set to `true` within a specific sport's configuration (e.g., in the `"nfl_scoreboard"` block), the system will **only** fetch and display games (Live, Recent, and Upcoming) that involve one of the teams listed in your `"favorite_teams"` array for that sport. This is the best way to reduce API calls and keep the display focused.
* **`"show_favorite_teams_only": false`**: When set to `false` (or omitted), the system will display **all** available games for that sport, ignoring the `"favorite_teams"` list completely.
**Example `config.json` for NFL:**
```json
"nfl_scoreboard": {
"enabled": true,
"show_odds": true,
"show_favorite_teams_only": true, // <-- Only shows games for DAL & TB
"favorite_teams": ["DAL", "TB"],
"fetch_past_games": 1,
"fetch_future_games": 1
},
```
### Odds Ticker Feature
The system includes a comprehensive odds ticker that displays betting odds for upcoming sports games. The ticker respects the `show_favorite_teams_only` setting from each individual sports module. For example, if `"show_favorite_teams_only": true` is set in the `nfl_scoreboard` config, the odds ticker will only show odds for your favorite NFL teams.
**Features:**
- **Multi-League Support**: NFL, NBA, MLB, NCAA Football
- **Configurable Leagues**: Choose which leagues to display
- **Favorite Teams Filter**: Obeys the `show_favorite_teams_only` setting in each sport's configuration block.
- **Team Logos**: Displays team logos alongside odds information
- **Comprehensive Odds**: Shows spreads, money lines, and over/under totals
- **Scrolling Display**: Smooth scrolling text with team logos
- **Time Display**: Shows game times in local timezone
**Display Format:**
```
[12:00 PM] DAL -6.5 ML -200 O/U 47.5 vs NYG ML +175
```
**Configuration:**
Add the following section to your `config/config.json`:
```json
{
"odds_ticker": {
"enabled": true,
"enabled_leagues": ["nfl", "nba", "mlb", "ncaa_fb"],
"update_interval": 3600,
"scroll_speed": 2,
"scroll_delay": 0.05,
"display_duration": 30
}
}
```
**Testing:**
You can test the odds ticker functionality using:
```bash
python test_odds_ticker.py
```
### Persistent Caching Setup
The LEDMatrix system uses persistent caching to improve performance and reduce API calls. When running with `sudo`, the system needs a persistent cache directory that survives restarts.
**First-Time Setup:**
Run the setup script to create a persistent cache directory:
```bash
chmod +x setup_cache.sh
./setup_cache.sh
```
This will:
- Create `/var/cache/ledmatrix/` directory
- Set proper ownership to your user account
- Set permissions to allow the daemon user (which the system runs as) to write
- Test writability for both your user and the daemon user
**If You Still See Cache Warnings:**
If you see warnings about using temporary cache directory, run the permissions fix:
```bash
chmod +x fix_cache_permissions.sh
./fix_cache_permissions.sh
```
**Manual Setup:**
If you prefer to set up manually:
```bash
sudo mkdir -p /var/cache/ledmatrix
sudo chown $USER:$USER /var/cache/ledmatrix
sudo chmod 777 /var/cache/ledmatrix
```
**Cache Locations (in order of preference):**
1. `~/.ledmatrix_cache/` (user's home directory) - **Most persistent**
2. `/var/cache/ledmatrix/` (system cache directory) - **Persistent across restarts**
3. `/opt/ledmatrix/cache/` (alternative persistent location)
4. `/tmp/ledmatrix_cache/` (temporary directory) - **NOT persistent**
**Note:** If the system falls back to `/tmp/ledmatrix_cache/`, you'll see a warning message and the cache will not persist across restarts.
------------------------------------------------------------------------------------
## Before Running the Display
- To allow the script to properly access fonts, you need to set the correct permissions on your home directory:
@@ -815,6 +868,10 @@ This will start the display cycle but only stays active as long as your ssh sess
-----------------------------------------------------------------------------------
<details>
<summary>Run on Startup Automatically with Systemd Service Installation</summary>
## Run on Startup Automatically with Systemd Service Installation
@@ -861,6 +918,12 @@ sudo systemctl disable ledmatrix.service
# Enable autostart
sudo systemctl enable ledmatrix.service
```
</details>
<details>
<summary>Convenience Scripts</summary>
### Convenience Scripts
@@ -879,12 +942,12 @@ Then use them to control the service:
sudo ./start_display.sh
sudo ./stop_display.sh
```
</details>
-----------------------------------------------------------------------------------
## Web Interface Installation
## Web Interface Installation (V2)
The LEDMatrix system includes a web interface that allows you to control and configure the display remotely. The web interface runs on port 5001 and provides real-time display preview, configuration management, and on-demand display controls.
The LEDMatrix system includes Web Interface V2 that runs on port 5001 and provides real-time display preview, configuration management, and on-demand display controls.
### Installing the Web Interface Service
@@ -979,35 +1042,14 @@ sudo systemctl enable ledmatrix-web.service
-----------------------------------------------------------------------------------
## Custom Fonts
You can add any font to the assets/fonts/ folder but they need to be .ttf or .btf(less support) and updated in display_manager.py
## Information
<details>
-----------------------------------------------------------------------------------
<summary>Display Settings from RGBLEDMatrix Library</summary>
### Running the display without Sudo (Not recommended but can be useful for troubleshooting or overcoming write errors)
To run the display script without `sudo`, the user executing the script needs access to GPIO pins. Add the user to the `gpio` group:
```bash
sudo usermod -a -G gpio <your_username>
# Example for user 'ledpi':
# sudo usermod -a -G gpio ledpi
```
**Important:** You must **reboot** the Raspberry Pi after adding the user to the group for the change to take effect.
You also need to disable hardware pulsing in the code (see `src/display_manager.py`, set `options.disable_hardware_pulsing = True`). This may result in a flickerying display
If configured correctly, you can then run:
```bash
python3 display_controller.py
```
-----------------------------------------------------------------------------------
## Display Settings
If you are copying my setup, you can likely leave this alone.
- hardware: Configures how the matrix is driven.
@@ -1025,147 +1067,54 @@ If you are copying my setup, you can likely leave this alone.
- Sports modules also support test_mode, live_update_interval, and favorite_teams.
- Logos are loaded from the logo_dir path under assets/sports/...
</details>
<details>
<summary>Cache Information</summary>
### Persistent Caching Setup
The LEDMatrix system uses persistent caching to improve performance and reduce API calls. When running with `sudo`, the system needs a persistent cache directory that survives restarts.
**First-Time Setup:**
Run the setup script to create a persistent cache directory:
```bash
Example: NHL Configuration"nhl_scoreboard": {
"enabled": true,
"test_mode": false,
"update_interval_seconds": 300,
"live_update_interval": 15,
"recent_game_hours": 48,
"favorite_teams": ["TB", "DAL"],
"logo_dir": "assets/sports/nhl_logos",
"display_modes": {
"nhl_live": true,
"nhl_recent": true,
"nhl_upcoming": true
}
}
chmod +x setup_cache.sh
./setup_cache.sh
```
## Date Format Configuration
This will:
- Create `/var/cache/ledmatrix/` directory
- Set proper ownership to your user account
- Set permissions to allow the daemon user (which the system runs as) to write
- Test writability for both your user and the daemon user
You can customize the date format for upcoming games across all sports displays. The `use_short_date_format` setting in `config/config.json` under the `display` section controls this behavior.
- **`"use_short_date_format": true`**: Displays dates in a short, numerical format (e.g., "8/30").
- **`"use_short_date_format": false`** (Default): Displays dates in a more descriptive format with an ordinal suffix (e.g., "Aug 30th").
### Example `config.json`
```json
"display": {
"hardware": {
...
},
"runtime": {
...
},
"display_durations": {
...
},
"use_short_date_format": false // Set to true for "8/30" format
},
**If You Still See Cache Warnings:**
If you see warnings about using temporary cache directory, run the permissions fix:
```bash
chmod +x fix_cache_permissions.sh
./fix_cache_permissions.sh
```
## Project Structure
```
LEDMatrix/
├── assets/ # Static assets like fonts and icons
├── config/ # Configuration files
│ ├── config.json # Main configuration
│ └── config_secrets.template.json # Template for API keys and sensitive data
├── src/ # Source code
│ ├── display_controller.py # Main application controller
│ ├── config_manager.py # Configuration management
│ ├── display_manager.py # LED matrix display handling
│ ├── cache_manager.py # Caching system for API data
│ ├── clock.py # Clock display module
│ ├── weather_manager.py # Weather display module
│ ├── weather_icons.py # Weather icon definitions
│ ├── stock_manager.py # Stock ticker display module
│ ├── stock_news_manager.py # Stock news display module
│ ├── music_manager.py # Music display orchestration
│ ├── spotify_client.py # Spotify API integration
│ ├── ytm_client.py # YouTube Music integration
│ ├── authenticate_spotify.py # Spotify authentication
│ ├── authenticate_ytm.py # YouTube Music authentication
│ ├── calendar_manager.py # Google Calendar integration
│ ├── youtube_display.py # YouTube channel stats display
│ ├── text_display.py # Custom text display module
│ ├── font_test_manager.py # Font testing utility
│ ├── nhl_managers.py # NHL game display
│ ├── nba_managers.py # NBA game display
│ ├── mlb_manager.py # MLB game display
│ ├── nfl_managers.py # NFL game display
│ ├── soccer_managers.py # Soccer game display
│ ├── ncaa_fb_managers.py # NCAA Football display
│ ├── ncaa_baseball_managers.py # NCAA Baseball display
│ └── ncaam_basketball_managers.py # NCAA Basketball display
├── rpi-rgb-led-matrix-master/ # LED matrix library
├── run.py # Main entry point
├── display_controller.py # Legacy entry point
├── calendar_registration.py # Calendar API setup
├── run_font_test.py # Font testing entry point
├── ChuckBuilds.py # Custom display module
├── start_display.sh # Service start script
├── stop_display.sh # Service stop script
├── install_service.sh # Service installation script
├── ledmatrix.service # Systemd service definition
├── requirements.txt # Python dependencies
└── config.example.json # Example configuration
**Manual Setup:**
If you prefer to set up manually:
```bash
sudo mkdir -p /var/cache/ledmatrix
sudo chown $USER:$USER /var/cache/ledmatrix
sudo chmod 777 /var/cache/ledmatrix
```
The project is organized into several key components:
**Cache Locations (in order of preference):**
1. `~/.ledmatrix_cache/` (user's home directory) - **Most persistent**
2. `/var/cache/ledmatrix/` (system cache directory) - **Persistent across restarts**
3. `/opt/ledmatrix/cache/` (alternative persistent location)
4. `/tmp/ledmatrix_cache/` (temporary directory) - **NOT persistent**
- `src/`: Contains all the Python source code, organized by feature
- `config/`: Configuration files for the application
- `assets/`: Static assets like fonts and icons
- `rpi-rgb-led-matrix-master/`: The LED matrix control library
- Various utility scripts for running and managing the service
**Note:** If the system falls back to `/tmp/ledmatrix_cache/`, you'll see a warning message and the cache will not persist across restarts.
Each display module in `src/` is responsible for a specific feature (weather, sports, music, etc.) and follows a consistent pattern of data fetching, processing, and display rendering.
## NHL, NBA, MLB, Soccer, NCAA FB, NCAA Men's Baseball, NCAA Men's Basketball Scoreboard Display
The LEDMatrix system includes a comprehensive scoreboard display system with three display modes:
### Display Modes
- **Live Games**: Shows currently playing games with live scores and game status
- **Recent Games**: Displays completed games from the last 48 hours (configurable)
- **Upcoming Games**: Shows scheduled games for favorite teams
### Features
- Real-time score updates from ESPN API
- Team logo display
- Game status indicators (period, time remaining)
- Configurable favorite teams
- Automatic game switching
- Built-in caching to reduce API calls
- Test mode for development
## API Usage Tracking
The LEDMatrix system includes a built-in API usage counter that tracks API calls made by various managers in a 24-hour rolling window. This feature helps monitor API usage and ensure compliance with rate limits.
### API Counter Features
- **Real-time Tracking**: Counts API calls for weather, stocks, sports, and news data
- **24-hour Window**: Rolling window that resets every 24 hours
- **Web Interface Integration**: View current usage in the Overview tab of the web interface
- **Forecast Display**: Shows predicted API usage based on current configuration
- **Automatic Reset**: Counters automatically reset when the 24-hour window expires
### Tracked API Calls
- **Weather**: OpenWeatherMap API calls (geocoding + weather data)
- **Stocks**: Yahoo Finance API calls for stock and crypto data
- **Sports**: ESPN API calls for various sports leagues (NHL, NBA, MLB, NFL, etc.)
- **News**: RSS feed and news API calls
### Accessing API Metrics
1. Open the web interface in your browser
2. Navigate to the **Overview** tab
3. Scroll down to the "API Calls (24h window)" section
4. Click "Refresh API Metrics" to update the display
The counter shows both actual usage and forecasted usage based on your current configuration settings.
## Caching System
@@ -1198,21 +1147,46 @@ The LEDMatrix system includes a robust caching mechanism to optimize API calls a
- Temporary files are used for safe updates
- JSON serialization handles all data types including timestamps
## Final Notes
- Most configuration is done via config/config.json
- Refresh intervals for sports/weather/stocks are customizable
- A caching system reduces API strain and helps ensure the display doesn't hammer external services (and ruin it for everyone)
- Font files should be placed in assets/fonts/
- You can test each module individually for debugging
##What's Next?
- Adding MQTT/HomeAssistant integration
- Gambling odds (done!)
- Building a user-friendly UI for easier configuration (done!)
</details>
<details>
<summary>Date Format Configuration </summary>
## Date Format Configuration
You can customize the date format for upcoming games across all sports displays. The `use_short_date_format` setting in `config/config.json` under the `display` section controls this behavior.
- **`"use_short_date_format": true`**: Displays dates in a short, numerical format (e.g., "8/30").
- **`"use_short_date_format": false`** (Default): Displays dates in a more descriptive format with an ordinal suffix (e.g., "Aug 30th").
### Example `config.json`
```json
"display": {
"hardware": {
...
},
"runtime": {
...
},
"display_durations": {
...
},
"use_short_date_format": false // Set to true for "8/30" format
},
```
</details>
-----------------------------------------------------------------------------------
<details>
<summary>Passwordless Sudo for Web Interface Actions</summary>
## Granting Passwordless Sudo Access for Web Interface Actions
@@ -1274,10 +1248,12 @@ Manual Method:
Granting passwordless `sudo` access, even for specific commands, has security implications. Ensure that the scripts and commands allowed are secure and cannot be easily exploited. The web interface itself should also be secured if it's exposed to untrusted networks.
For `display_controller.py` and `stop_display.sh`, ensure their file permissions restrict write access to only trusted users, preventing unauthorized modification of these scripts which run with elevated privileges.
</details>
## Web Interface V2 (simplified quick start)
### 1) un the helper (does the above and starts the server):
### 1) Run the helper (does the above and starts the server):
```
python3 start_web_v2.py
```
@@ -1287,18 +1263,29 @@ python3 start_web_v2.py
python web_interface_v2.py
```
### 3) Autostart (optional)
### 3) Autostart (recommended)
Set `"web_display_autostart": true` in `config/config.json`.
Ensure your systemd service (or launcher) calls `start_web_conditionally.py`.
Ensure your systemd service calls `start_web_conditionally.py` (installed by `install_service.sh`).
### 4) Permissions (optional but recommended)
- Add the service user to `systemd-journal` for viewing logs without sudo.
- Configure passwordless sudo for actions (start/stop service, reboot, shutdown) if desired.
- Required for web Ui actions, look in the section above for the commands to run (chmod +x configure_web_sudo.sh & ./configure_web_sudo.sh)
### 5) Old web UI (v1)
The project now defaults to Web UI v2. The v1 interface can be ignored.
An LED matrix display system that provides real-time information display capabilities for various data sources. The system is highly configurable and supports multiple display modes that can be enabled or disabled based on user preferences.
## Final Notes
- Most configuration is done via config/config.json
- Refresh intervals for sports/weather/stocks are customizable
- A caching system reduces API strain and helps ensure the display doesn't hammer external services (and ruin it for everyone)
- Font files should be placed in assets/fonts/
- You can test each module individually for debugging
##What's Next?
- Adding MQTT/HomeAssistant integration
### If you've read this far — thanks!

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

BIN
assets/news_logos/cbc.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
assets/news_logos/cnn.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

View File

@@ -1,404 +1,53 @@
NCAAF
AAMU => Alabama A&M Bulldogs
ACU => Abilene Christian Wildcats
ADA => Adams State Grizzlies
ADR => Adrian Bulldogs
AFA => Air Force Falcons
AIC => American International Yellow Jackets
AKR => Akron Zips
ALA => Alabama Crimson Tide
ALB => Albright Lions
ALBS => Albany State (GA) Golden Rams
ALCN => Alcorn State Braves
ALD => Alderson Broaddus Battlers
ALF => Alfred Saxons
ALL => Allegheny Gators
ALST => Alabama State Hornets
AMH => Amherst College Mammoths
AND => Anderson (IN) Ravens
ANG => Angelo State Rams
AMH => Amherst Mammoths
ANN => Anna Maria College Amcats
APP => Appalachian State Mountaineers
APSU => Austin Peay Governors
ARIZ => Arizona Wildcats
ARK => Arkansas-Monticello Boll Weevils
ARMY => Army Black Knights
ARST => Arkansas State Red Wolves
ASH => Ashland Eagles
ASP => Assumption Greyhounds
ARK => Arkansas Razorbacks
ASU => Arizona State Sun Devils
AUB => Auburn Tigers
AUG => St. Augustine's Falcons
AUR => Aurora Spartans
AUS => Austin College 'Roos
AVE => Averett Cougars
AVI => Avila College Eagles
AZU => Azusa Pacific Cougars
BAK => Baker University Wildcats
BAL => Baldwin Wallace Yellow Jackets
BALL => Ball State Cardinals
BAT => Bates College Bobcats
BAY => Baylor Bears
BC => Boston College Eagles
BEC => Becker College Hawks
BEL => Beloit College Buccaneers
BEN => Benedictine University (IL) Eagles
BENT => Bentley Falcons
BET => Bethel (TN) Wildcats
BGSU => Bowling Green Falcons
BHS => Black Hills State Yellow Jackets
BIR => Birmingham-Southern Panthers
BKN => Bacone College Warriors
BLA => Blackburn Beavers
BLOM => Bloomsburg Huskies
BLU => Bluffton Beavers
BOW => Bowdoin Polar Bears
BRI => British Columbia Thunderbirds
BRWN => Brown Bears
BST => Bemidji State Beavers
BSU => Bowie State Bulldogs
BUCK => Bucknell Bison
BUE => Buena Vista Beavers
BUF => Buffalo State Bengals
BUFF => Buffalo Bulls
BUT => Butler Bulldogs
BYU => BYU Cougars
CAL => California Lutheran Kingsmen
CAM => Campbell Fighting Camels
CAP => Capital University Crusaders
CAR => Carthage College Red Men
CARK => Central Arkansas Bears
CAS => Castleton Spartans
CAT => Catholic University Cardinals
CCSU => Central Connecticut Blue Devils
CCU => Coastal Carolina Chanticleers
CEN => Centre College Colonels
CHA => Chapman University Panthers
CHI => Chicago Maroons
CHSO => Charleston Southern Buccaneers
CIN => Cincinnati Bearcats
CLA => Clarion Golden Eagles
CLEM => Clemson Tigers
CLMB => Columbia Lions
CLT => Charlotte 49ers
CMU => Central Michigan Chippewas
COE => Coe College Kohawks
COL => Colorado School of Mines Orediggers
COLC => Colorado College Tigers
COLG => Colgate Raiders
BOIS => Boise State Broncos
BRST => Bridgewater State Bears
BUENA => Buena Vista Beavers
CAL => California Golden Bears
CAR => Carroll University (WI) Pioneers
CLA => Claremont-Mudd-Scripps College Stags
COLBY => Colby College White Mules
COLO => Colorado Buffaloes
CON => Concordia-Minnesota Cobbers
COR => Cornell College (IA) Rams
CONN => UConn Huskies
CP => Cal Poly Mustangs
CRO => Crown Storm
CSU => Colorado State Rams
CUL => Culver-Stockton Wildcats
CUM => Cumberland College Indians
CUR => Curry College Colonels
DAK => Dakota Wesleyan Tigers
DART => Dartmouth Big Green
DAV => Davidson Wildcats
DAY => Dayton Flyers
DEF => Defiance Yellow Jackets
DEL => Delta State Statesmen
DEN => Denison Big Red
DEP => DePauw Tigers
DIC => Dickinson State Blue Hawks
DRKE => Drake Bulldogs
DSU => Delaware State Hornets
DEL => Delaware Blue Hens
DUB => Dubuque Spartans
DUKE => Duke Blue Devils
DUQ => Duquesne Dukes
EAS => Eastern New Mexico Greyhounds
ECU => East Carolina Pirates
EDI => Edinboro Fighting Scots
EIU => Eastern Illinois Panthers
EKU => Eastern Kentucky Colonels
ELI => Elizabeth City State Vikings
ELM => Elmhurst Blue Jays
ELON => Elon Phoenix
EMO => Emory & Henry Wasps
EMP => Emporia State Hornets
EMU => Eastern Michigan Eagles
END => Endicott College Gulls
EOR => Eastern Oregon Mountaineers
ETSU => East Tennessee State Buccaneers
EUR => Eureka College Red Devils
EWU => Eastern Washington Eagles
FAU => Florida Atlantic Owls
FAY => Fayetteville State Broncos
FDU => FDU-Florham Devils
FER => Ferrum Panthers
FIN => Findlay Oilers
FIT => Fitchburg State Falcons
FIU => Florida International Panthers
ELM => Elmhurst Bluejays
FAMU => Florida A&M Rattlers
FLA => Florida Gators
FOR => Fort Valley State Wildcats
FRA => Franklin Grizzlies
FRES => Fresno State Bulldogs
FRO => Frostburg State Bobcats
FRST => Ferris State Bulldogs
FSU => Florida State Seminoles
FTLW => Fort Lewis Skyhawks
FUR => Furman Paladins
GAL => Gallaudet Bison
GAN => Gannon Golden Knights
GASO => Georgia Southern Eagles
GAST => Georgia State Panthers
GEN => Geneva College Golden Tornadoes
GEO => George Fox University Bruins
GET => Gettysburg Bullets
GLE => Glenville State Pioneers
GMU => George Mason Patriots
GRA => Grand Valley State Lakers
GRE => Greenville Panthers
GRI => Grinnell Pioneers
GRO => Grove City College Wolverines
GT => Georgia Tech Yellow Jackets
GUI => Guilford Quakers
GWEB => Gardner-Webb Bulldogs
HAM => Hampden-Sydney Tigers
HAMP => Hampton Pirates
HAN => Hanover Panthers
HAR => Hartwick Hawks
HARV => Harvard Crimson
HAS => Haskell Indian Nations Jayhawks
GTWN => Georgetown Hoyas
HAW => Hawai'i Rainbow Warriors
HBU => Houston Baptist Huskies
HC => Holy Cross Crusaders
HEI => Heidelberg Student Princes
HEN => Hendrix College Warriors
HIL => Hillsdale Chargers
HIR => Hiram College Terriers
HOB => Hobart Statesmen
HOU => Houston Cougars
HOW => Howard Bison
HUS => Husson Eagles
IDHO => Idaho Vandals
IDST => Idaho State Bengals
ILL => Illinois Fighting Illini
ILST => Illinois State Redbirds
ILW => Illinois Wesleyan Titans
IND => Indianapolis
INST => Indiana State Sycamores
IOW => Iowa Wesleyan Tigers
IOWA => Iowa Hawkeyes
ISU => Iowa State Cyclones
ITH => Ithaca Bombers
IU => Indiana Hoosiers
JKST => Jackson State Tigers
JMU => James Madison Dukes
JOH => Johnson C Smith Golden Bulls
JUN => Juniata Eagles
JVST => Jacksonville State Gamecocks
KAL => Kalamazoo Hornets
KAN => Kansas Wesleyan University Coyotes
KEN => Kenyon Lords
KENN => Kennesaw State Owls
KENT => Kent State Golden Flashes
KIN => King's College (PA) Monarchs
KNO => Knox College Prairie Fire
KSU => Kansas State Wildcats
KU => Kansas Jayhawks
KUT => Kutztown Golden Bears
KYST => Kentucky State Thorobreds
KYW => Kentucky Wesleyan Panthers
LA => La Verne Leopards
LAC => Lane Dragons
LAF => Lafayette Leopards
LAG => LaGrange College Panthers
LAK => Lake Forest Foresters
LAM => Lambuth Eagles
LAN => Langston Lions
LAW => Lawrence Vikings
LEB => Lebanon Valley Flying Dutchmen
LEH => Lehigh Mountain Hawks
LEN => Lenoir-Rhyne Bears
LEW => Lewis & Clark Pioneers
LIB => Liberty Flames
LIM => Limestone Saints
LIN => Linfield Wildcats
LOC => Lock Haven Bald Eagles
LOR => Loras College Duhawks
LOU => Louisville Cardinals
LSU => LSU Tigers
LT => Louisiana Tech Bulldogs
JXST => Jacksonville State Gamecocks
LUT => Luther Norse
LYC => Lycoming Warriors
M-OH => Miami (OH) RedHawks
MAC => Macalester Scots
MAI => Maine Maritime Mariners
MAN => Mansfield Mountaineers
MAR => Maryville College Fighting Scots
MAS => Mass Maritime Buccaneers
MASS => UMass Minutemen
MAY => Mayville State Comets
MCM => McMurry War Hawks
MCN => McNeese Cowboys
MD => Maryland Terrapins
MEM => Memphis Tigers
MEN => Menlo College Oaks
MER => Merchant Marine Mariners
MERC => Mercyhurst Lakers
MES => Colorado Mesa Mavericks
MET => Methodist Monarchs
MH => Mars Hill Mountain Lions
MIAMI => Miami Hurricanes
MICH => Michigan Wolverines
MID => Midwestern State Mustangs
MIL => Millsaps Majors
MIN => Minot State Beavers
MINN => Minnesota Golden Gophers
MIS => Missouri Western Griffons
MISS => Ole Miss Rebels
MIZ => Missouri Tigers
MNST => Minnesota State Mavericks
MONM => Monmouth Hawks
MONT => Montana Grizzlies
MOR => Morningside Chiefs
MORE => Morehead State Eagles
MORG => Morgan State Bears
MOU => Mount Union Raiders
MRSH => Marshall Thundering Herd
MRST => Marist Red Foxes
MSST => Mississippi State Bulldogs
MSU => Michigan State Spartans
MTST => Montana State Bobcats
MTSU => Middle Tennessee Blue Raiders
MTU => Michigan Tech Huskies
MUH => Muhlenberg Mules
MUR => Murray State Racers
MUS => Muskingum Fighting Muskies
MVSU => Mississippi Valley State Delta Devils
NAU => Northern Arizona Lumberjacks
NAVY => Navy Midshipmen
NBY => Newberry Wolves
NCAT => North Carolina A&T Aggies
NCCU => North Carolina Central Eagles
NCST => NC State Wolfpack
ND => Notre Dame Fighting Irish
NDOH => Notre Dame College Falcons
NDSU => North Dakota State Bison
NEB => Nebraska-Kearney Lopers
NEV => Nevada Wolf Pack
NH => New Haven Chargers
NICH => Nicholls Colonels
NIU => Northern Illinois Huskies
NMH => New Mexico Highlands Cowboys
NMI => Northern Michigan Wildcats
NMSU => New Mexico State Aggies
NOR => Univ. of Northwestern-St. Paul Eagles
NORF => Norfolk State Spartans
NW => Northwestern Wildcats
OBE => Oberlin Yeomen
ODU => Old Dominion Monarchs
OHI => Ohio Northern Polar Bears
OHIO => Ohio Bobcats
OKL => Oklahoma Baptist Bison
OKST => Oklahoma State Cowboys
OLI => Olivet College Comets
OMA => Omaha Mavericks
ORST => Oregon State Beavers
OSU => Ohio State Buckeyes
OTT => Otterbein Cardinals
OU => Oklahoma Sooners
PAC => Pacific (OR) Boxers
PENN => Pennsylvania Quakers
PIKE => Pikeville Bears
PITT => Pittsburgh Panthers
PRE => Presentation College Saints
PRI => Principia College Panthers
PRIN => Princeton Tigers
PST => Pittsburg State Gorillas
PSU => Penn State Nittany Lions
MESA => Colorado Mesa Mavericks
MIL => Millikin Big Blue
MOR => Morehouse College Maroon Tigers
NOR => North Park Vikings
RED => Redlands Bulldogs
RICE => Rice Owls
RICH => Richmond Spiders
RIT => Rochester Yellow Jackets
ROB => Robert Morris (IL) Eagles
ROS => Rose-Hulman Engineers
RUTG => Rutgers Scarlet Knights
SAC => Sacramento State Hornets
SAG => Saginaw Valley Cardinals
SDAK => South Dakota Coyotes
SDSU => San Diego State Aztecs
SET => Seton Hill Griffins
SIU => Southern Illinois Salukis
SJSU => San José State Spartans
SLI => Slippery Rock The Rock
SOU => Southwestern College Moundbuilders
SPR => Springfield College Pride
ST => St. Scholastica Saints
STAN => Stanford Cardinal
STE => Stevenson University Mustangs
STET => Stetson Hatters
STO => Stonehill College Skyhawks
SUS => Susquehanna University River Hawks
SUU => Southern Utah Thunderbirds
SYR => Syracuse Orange
TA&M => Texas A&M Aggies
TAY => Taylor Trojans
TEM => Temple Owls
TEX => Texas Longhorns
TIF => Tiffin University Dragons
TLSA => Tulsa Golden Hurricane
TRI => Trinity University (TX) Tigers
TUF => Tufts University Jumbos
TXST => Texas State Bobcats
UAB => UAB Blazers
UAPB => Arkansas-Pine Bluff Golden Lions
UCD => UC Davis Aggies
UCF => UCF Knights
UCLA => UCLA Bruins
UCONN => UConn Huskies
UGA => Georgia Bulldogs
UK => Kentucky Wildcats
UL => Louisiana Ragin' Cajuns
ULM => UL Monroe Warhawks
UMD => Minnesota-Duluth Bulldogs
UMDA => UMASS Dartmouth Corsairs
UML => UMass Lowell River Hawks
UNA => North Alabama Lions
UNC => North Carolina Tar Heels
UNCO => Northern Colorado Bears
UND => North Dakota Fighting Hawks
UNH => New Hampshire Wildcats
UNI => University of Mary Marauders
UNLV => UNLV Rebels
UNM => New Mexico Lobos
UNNY => Union Dutchmen
UNT => North Texas Mean Green
UPP => Upper Iowa Peacocks
URI => Rhode Island Rams
USA => South Alabama Jaguars
USC => USC Trojans
USD => San Diego Toreros
USF => South Florida Bulls
USU => Utah State Aggies
UTAH => Utah Utes
UTC => Chattanooga Mocs
UTI => Utica College Pioneers
UVA => Virginia Cavaliers
VAL => Valley City State Vikings
VAN => Vanderbilt Commodores
VILL => Villanova Wildcats
VIR => Virginia State Trojans
VT => Virginia Tech Hokies
WAB => Wabash College Little Giants
WAKE => Wake Forest Demon Deacons
WAS => Washington-Missouri Bears
WASH => Washington Huskies
WAY => Wayne State (MI) Warriors
WES => Westminster College (MO) Blue Jays
WHE => Wheaton College Illinois Thunder
WIL => Wilkes University Colonels
WIN => Wingate Bulldogs
WIS => Wisconsin-Platteville Pioneers
WISC => Wisconsin Badgers
WKU => Western Kentucky Hilltoppers
WOR => Worcester State College Lancers
WSU => Washington State Cougars
WVU => West Virginia Mountaineers
YALE => Yale Bulldogs
NBA
@@ -1106,6 +755,181 @@ MLB Conferences/Divisions
OAK => Oakland Athletics
SEA => Seattle Mariners
TEX => Texas Rangers
Soccer Leagues:
LEAGUE_SLUGS = {
"eng.1": "Premier League",
"esp.1": "La Liga",
"ger.1": "Bundesliga",
"ita.1": "Serie A",
"fra.1": "Ligue 1",
"uefa.champions": "Champions League",
"uefa.europa": "Europa League",
"usa.1": "MLS",
"por.1": "Liga Portugal", # Add this line
}
Soccer - Premier League (England)
ARS => Arsenal
AVL => Aston Villa
BHA => Brighton & Hove Albion
BOU => AFC Bournemouth
BRE => Brentford
BUR => Burnley
CHE => Chelsea
CRY => Crystal Palace
EVE => Everton
FUL => Fulham
LIV => Liverpool
LUT => Luton Town
MCI => Manchester City
MUN => Manchester United
NEW => Newcastle United
NFO => Nottingham Forest
SHU => Sheffield United
TOT => Tottenham Hotspur
WHU => West Ham United
WOL => Wolverhampton Wanderers
Soccer - La Liga (Spain)
ALA => Alavés
ATH => Athletic Bilbao
ATM => Atlético Madrid
BAR => Barcelona
BET => Real Betis
CAG => Cagliari
CEL => Celta Vigo
ESP => Espanyol
GET => Getafe
GIR => Girona
LAZ => Lazio
LEG => Leganés
RAY => Rayo Vallecano
RMA => Real Madrid
SEV => Sevilla
VAL => Valencia
VLD => Valladolid
Soccer - Bundesliga (Germany)
BOC => VfL Bochum
BOL => VfL Bochum
DOR => Borussia Dortmund
FCA => FC Augsburg
FCB => Bayern Munich
FCU => FC Union Berlin
HAC => Hannover 96
HDH => Hertha BSC
KOL => 1. FC Köln
LEV => Bayer Leverkusen
M05 => Mainz 05
RBL => RB Leipzig
SCF => SC Freiburg
SGE => Eintracht Frankfurt
STU => VfB Stuttgart
SVW => Werder Bremen
TSG => TSG Hoffenheim
WOB => VfL Wolfsburg
Soccer - Serie A (Italy)
ATA => Atalanta
CAG => Cagliari
EMP => Empoli
FIO => Fiorentina
INT => Inter Milan
JUV => Juventus
LAZ => Lazio
MIL => AC Milan
MON => Monza
NAP => Napoli
ROM => Roma
TOR => Torino
UDI => Udinese
VER => Hellas Verona
Soccer - Ligue 1 (France)
LIL => Lille
LPM => Lille
LYON => Lyon
MAR => Marseille
MON => Monaco
NAN => Nantes
NICE => Nice
OL => Olympique Lyonnais
OM => Olympique de Marseille
PAR => Paris Saint-Germain
PSG => Paris Saint-Germain
REN => Rennes
STR => Strasbourg
Soccer - Champions League
AJA => Ajax
ASM => AS Monaco
ASS => AS Saint-Étienne
BOC => VfL Bochum
CEL => Celtic
COM => Club Brugge
FCA => FC Augsburg
FCB => Bayern Munich
FCU => FC Union Berlin
FIO => Fiorentina
GEN => Genoa
HAC => Hannover 96
IPS => Ipswich Town
KSV => Kaiserslautern
LEC => Lecce
LIL => Lille
LIV => Liverpool
M05 => Mainz 05
MCI => Manchester City
MUN => Manchester United
NAN => Nantes
OSA => Osasuna
RBL => RB Leipzig
RCL => RC Lens
RMA => Real Madrid
SCF => SC Freiburg
SGE => Eintracht Frankfurt
SR => Sporting CP
STP => St. Pauli
SVW => Werder Bremen
TFC => Toulouse FC
TOT => Tottenham Hotspur
TSG => TSG Hoffenheim
UDI => Udinese
VEN => Venezia
VFB => VfB Stuttgart
VIL => Villarreal
Soccer - Liga Portugal (Portugal)
ARO => Arouca
BEN => SL Benfica
BRA => SC Braga
CHA => Chaves
EST => Estoril Praia
FAM => Famalicão
GIL => Gil Vicente
MOR => Moreirense
POR => FC Porto
PTM => Portimonense
RIO => Rio Ave
SR => Sporting CP
VGU => Vitória de Guimarães
VSC => Vitória de Setúbal
Soccer - Other Teams
austin => Austin FC
cf_montral => CF Montréal
charlotte => Charlotte FC
dortmund => Borussia Dortmund
gladbach => Borussia Mönchengladbach
lafc => Los Angeles FC
leverkusen => Bayer Leverkusen
nycfc => New York City FC
paris_sg => Paris Saint-Germain
st_louis => St. Louis City SC
MLS Conferences/Divisions
Conferences currently unsupported

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 KiB

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 409 B

View File

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

View File

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

View File

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

View File

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Some files were not shown because too many files have changed in this diff Show More