* 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
* 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>
* 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>
* 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
* 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.
* 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
* 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>