Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed assets/sports/ncaa_fbs_logos/ncaam.png
Binary file not shown.
Binary file added assets/sports/ncaa_logos/AIC.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added assets/sports/ncaa_logos/BU.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added assets/sports/ncaa_logos/DAL.png
Binary file added assets/sports/ncaa_logos/DEN.png
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added assets/sports/ncaa_logos/ME.png
Binary file added assets/sports/ncaa_logos/MSU.png
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added assets/sports/ncaa_logos/PU.png
Binary file added assets/sports/ncaa_logos/RIT.png
File renamed without changes
File renamed without changes
Binary file added assets/sports/ncaa_logos/SHU.png
Binary file added assets/sports/ncaa_logos/TB.png
File renamed without changes
File renamed without changes
Binary file added assets/sports/ncaa_logos/UIW.png
File renamed without changes
File renamed without changes
Binary file added assets/sports/ncaa_logos/UTSA.png
Binary file added assets/sports/ncaa_logos/ncaah.png
Binary file added assets/sports/ncaa_logos/ncaam.png
39 changes: 35 additions & 4 deletions config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@
"ncaam_basketball": {
"enabled": false,
"top_teams": 25
},
"ncaam_hockey": {
"enabled": true,
"top_teams": 10,
"show_ranking": true
}
},
"update_interval": 3600,
Expand Down Expand Up @@ -297,7 +302,7 @@
"UGA",
"AUB"
],
"logo_dir": "assets/sports/ncaa_fbs_logos",
"logo_dir": "assets/sports/ncaa_logos",
"show_records": true,
"show_ranking": true,
"display_modes": {
Expand All @@ -323,7 +328,7 @@
"UGA",
"AUB"
],
"logo_dir": "assets/sports/ncaa_fbs_logos",
"logo_dir": "assets/sports/ncaa_logos",
"show_records": true,
"display_modes": {
"ncaa_baseball_live": true,
Expand All @@ -346,14 +351,40 @@
"UGA",
"AUB"
],
"logo_dir": "assets/sports/ncaa_fbs_logos",
"logo_dir": "assets/sports/ncaa_logos",
"show_records": true,
"display_modes": {
"ncaam_basketball_live": true,
"ncaam_basketball_recent": true,
"ncaam_basketball_upcoming": true
}
},
"ncaam_hockey_scoreboard": {
"enabled": true,
"live_priority": true,
"live_game_duration": 20,
"show_odds": true,
"test_mode": false,
"update_interval_seconds": 3600,
"live_update_interval": 30,
"live_odds_update_interval": 3600,
"odds_update_interval": 3600,
"season_cache_duration_seconds": 86400,
"recent_games_to_show": 1,
"upcoming_games_to_show": 1,
"show_favorite_teams_only": true,
"favorite_teams": [
"RIT"
],
"logo_dir": "assets/sports/ncaa_logos",
"show_records": true,
"show_ranking": true,
"display_modes": {
"ncaam_hockey_live": true,
"ncaam_hockey_recent": true ,
"ncaam_hockey_upcoming": true
}
},
"youtube": {
"enabled": false,
"update_interval": 3600
Expand Down Expand Up @@ -517,4 +548,4 @@
0
]
}
}
}
1 change: 1 addition & 0 deletions requirements-emulator.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
RGBMatrixEmulator
1 change: 0 additions & 1 deletion src/calendar_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import pickle
from PIL import Image, ImageDraw, ImageFont
import numpy as np
from rgbmatrix import graphics
import pytz
from src.config_manager import ConfigManager
import time
Expand Down
50 changes: 48 additions & 2 deletions src/display_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from src.ncaa_fb_managers import NCAAFBLiveManager, NCAAFBRecentManager, NCAAFBUpcomingManager
from src.ncaa_baseball_managers import NCAABaseballLiveManager, NCAABaseballRecentManager, NCAABaseballUpcomingManager
from src.ncaam_basketball_managers import NCAAMBasketballLiveManager, NCAAMBasketballRecentManager, NCAAMBasketballUpcomingManager
from src.ncaam_hockey_managers import NCAAMHockeyLiveManager, NCAAMHockeyRecentManager, NCAAMHockeyUpcomingManager
from src.youtube_display import YouTubeDisplay
from src.calendar_manager import CalendarManager
from src.text_display import TextDisplay
Expand Down Expand Up @@ -235,6 +236,21 @@ def __init__(self):
self.ncaam_basketball_recent = None
self.ncaam_basketball_upcoming = None
logger.info("NCAA Men's Basketball managers initialized in %.3f seconds", time.time() - ncaam_basketball_time)

# Initialize NCAA Men's Hockey managers if enabled
ncaam_hockey_time = time.time()
ncaam_hockey_enabled = self.config.get('ncaam_hockey_scoreboard', {}).get('enabled', False)
ncaam_hockey_display_modes = self.config.get('ncaam_hockey_scoreboard', {}).get('display_modes', {})

if ncaam_hockey_enabled:
self.ncaam_hockey_live = NCAAMHockeyLiveManager(self.config, self.display_manager, self.cache_manager) if ncaam_hockey_display_modes.get('ncaam_hockey_live', True) else None
self.ncaam_hockey_recent = NCAAMHockeyRecentManager(self.config, self.display_manager, self.cache_manager) if ncaam_hockey_display_modes.get('ncaam_hockey_recent', True) else None
self.ncaam_hockey_upcoming = NCAAMHockeyUpcomingManager(self.config, self.display_manager, self.cache_manager) if ncaam_hockey_display_modes.get('ncaam_hockey_upcoming', True) else None
else:
self.ncaam_hockey_live = None
self.ncaam_hockey_recent = None
self.ncaam_hockey_upcoming = None
logger.info("NCAA Men's Hockey managers initialized in %.3f seconds", time.time() - ncaam_hockey_time)

# Track MLB rotation state
self.mlb_current_team_index = 0
Expand All @@ -252,6 +268,7 @@ def __init__(self):
self.ncaa_fb_live_priority = self.config.get('ncaa_fb_scoreboard', {}).get('live_priority', True)
self.ncaa_baseball_live_priority = self.config.get('ncaa_baseball_scoreboard', {}).get('live_priority', True)
self.ncaam_basketball_live_priority = self.config.get('ncaam_basketball_scoreboard', {}).get('live_priority', True)
self.ncaam_hockey_live_priority = self.config.get('ncaam_hockey_scoreboard', {}).get('live_priority', True)

# List of available display modes (adjust order as desired)
self.available_modes = []
Expand Down Expand Up @@ -297,6 +314,9 @@ def __init__(self):
if ncaam_basketball_enabled:
if self.ncaam_basketball_recent: self.available_modes.append('ncaam_basketball_recent')
if self.ncaam_basketball_upcoming: self.available_modes.append('ncaam_basketball_upcoming')
if ncaam_hockey_enabled:
if self.ncaam_hockey_recent: self.available_modes.append('ncaam_hockey_recent')
if self.ncaam_hockey_upcoming: self.available_modes.append('ncaam_hockey_upcoming')
# Add live modes to rotation if live_priority is False and there are live games
self._update_live_modes_in_rotation()

Expand Down Expand Up @@ -399,7 +419,10 @@ def __init__(self):
'ncaa_baseball_upcoming': 15,
'ncaam_basketball_live': 30, # Added NCAA Men's Basketball durations
'ncaam_basketball_recent': 15,
'ncaam_basketball_upcoming': 15
'ncaam_basketball_upcoming': 15,
'ncaam_hockey_live': 30, # Added NCAA Men's Hockey durations
'ncaam_hockey_recent': 15,
'ncaam_hockey_upcoming': 15
}
# Merge loaded durations with defaults
for key, value in default_durations.items():
Expand Down Expand Up @@ -622,6 +645,10 @@ def _update_modules(self):
if self.ncaam_basketball_live: self.ncaam_basketball_live.update()
if self.ncaam_basketball_recent: self.ncaam_basketball_recent.update()
if self.ncaam_basketball_upcoming: self.ncaam_basketball_upcoming.update()
elif current_sport == 'ncaam_hockey':
if self.ncaam_hockey_live: self.ncaam_hockey_live.update()
if self.ncaam_hockey_recent: self.ncaam_hockey_recent.update()
if self.ncaam_hockey_upcoming: self.ncaam_hockey_upcoming.update()
else:
# If no specific sport is active, update all managers (fallback behavior)
# This ensures data is available when switching to a sport
Expand Down Expand Up @@ -661,6 +688,10 @@ def _update_modules(self):
if self.ncaam_basketball_recent: self.ncaam_basketball_recent.update()
if self.ncaam_basketball_upcoming: self.ncaam_basketball_upcoming.update()

if self.ncaam_hockey_live: self.ncaam_hockey_live.update()
if self.ncaam_hockey_recent: self.ncaam_hockey_recent.update()
if self.ncaam_hockey_upcoming: self.ncaam_hockey_upcoming.update()

def _check_live_games(self) -> tuple:
"""
Check if there are any live games available.
Expand Down Expand Up @@ -688,6 +719,8 @@ def _check_live_games(self) -> tuple:
live_checks['ncaa_baseball'] = self.ncaa_baseball_live and self.ncaa_baseball_live.live_games
if 'ncaam_basketball_scoreboard' in self.config and self.config['ncaam_basketball_scoreboard'].get('enabled', False):
live_checks['ncaam_basketball'] = self.ncaam_basketball_live and self.ncaam_basketball_live.live_games
if 'ncaam_hockey_scoreboard' in self.config and self.config['ncaam_hockey_scoreboard'].get('enabled', False):
live_checks['ncaam_hockey'] = self.ncaam_hockey_live and self.ncaam_hockey_live.live_games

for sport, has_live_games in live_checks.items():
if has_live_games:
Expand Down Expand Up @@ -938,6 +971,7 @@ def update_mode(mode_name, manager, live_priority, sport_enabled):
ncaa_fb_enabled = self.config.get('ncaa_fb_scoreboard', {}).get('enabled', False)
ncaa_baseball_enabled = self.config.get('ncaa_baseball_scoreboard', {}).get('enabled', False)
ncaam_basketball_enabled = self.config.get('ncaam_basketball_scoreboard', {}).get('enabled', False)
ncaam_hockey_enabled = self.config.get('ncaam_hockey_scoreboard', {}).get('enabled', False)

update_mode('nhl_live', getattr(self, 'nhl_live', None), self.nhl_live_priority, nhl_enabled)
update_mode('nba_live', getattr(self, 'nba_live', None), self.nba_live_priority, nba_enabled)
Expand All @@ -948,6 +982,7 @@ def update_mode(mode_name, manager, live_priority, sport_enabled):
update_mode('ncaa_fb_live', getattr(self, 'ncaa_fb_live', None), self.ncaa_fb_live_priority, ncaa_fb_enabled)
update_mode('ncaa_baseball_live', getattr(self, 'ncaa_baseball_live', None), self.ncaa_baseball_live_priority, ncaa_baseball_enabled)
update_mode('ncaam_basketball_live', getattr(self, 'ncaam_basketball_live', None), self.ncaam_basketball_live_priority, ncaam_basketball_enabled)
update_mode('ncaam_hockey_live', getattr(self, 'ncaam_hockey_live', None), self.ncaam_hockey_live_priority, ncaam_hockey_enabled)

def run(self):
"""Run the display controller, switching between displays."""
Expand Down Expand Up @@ -990,7 +1025,8 @@ def run(self):
('nfl', 'nfl_live', self.nfl_live_priority),
('ncaa_fb', 'ncaa_fb_live', self.ncaa_fb_live_priority),
('ncaa_baseball', 'ncaa_baseball_live', self.ncaa_baseball_live_priority),
('ncaam_basketball', 'ncaam_basketball_live', self.ncaam_basketball_live_priority)
('ncaam_basketball', 'ncaam_basketball_live', self.ncaam_basketball_live_priority),
('ncaam_hockey', 'ncaam_hockey_live', self.ncaam_hockey_live_priority)
]:
manager = getattr(self, attr, None)
# Only consider sports that are enabled (manager is not None) and have actual live games
Expand Down Expand Up @@ -1191,6 +1227,12 @@ def run(self):
manager_to_display = self.ncaa_baseball_live
elif self.current_display_mode == 'ncaam_basketball_live' and self.ncaam_basketball_live:
manager_to_display = self.ncaam_basketball_live
elif self.current_display_mode == 'ncaam_hockey_live' and self.ncaam_hockey_live:
manager_to_display = self.ncaam_hockey_live
elif self.current_display_mode == 'ncaam_hockey_recent' and self.ncaam_hockey_recent:
manager_to_display = self.ncaam_hockey_recent
elif self.current_display_mode == 'ncaam_hockey_upcoming' and self.ncaam_hockey_upcoming:
manager_to_display = self.ncaam_hockey_upcoming
elif self.current_display_mode == 'mlb_live' and self.mlb_live:
manager_to_display = self.mlb_live
elif self.current_display_mode == 'milb_live' and self.milb_live:
Expand Down Expand Up @@ -1255,6 +1297,10 @@ def run(self):
self.ncaa_baseball_recent.display(force_clear=self.force_clear)
elif self.current_display_mode == 'ncaa_baseball_upcoming' and self.ncaa_baseball_upcoming:
self.ncaa_baseball_upcoming.display(force_clear=self.force_clear)
elif self.current_display_mode == 'ncaam_hockey_recent' and self.ncaam_hockey_recent:
self.ncaam_hockey_recent.display(force_clear=self.force_clear)
elif self.current_display_mode == 'ncaam_hockey_upcoming' and self.ncaam_hockey_upcoming:
self.ncaam_hockey_upcoming.display(force_clear=self.force_clear)
elif self.current_display_mode == 'milb_live' and self.milb_live and len(self.milb_live.live_games) > 0:
logger.debug(f"[DisplayController] Calling MiLB live display with {len(self.milb_live.live_games)} live games")
# Update data before displaying for live managers
Expand Down
6 changes: 5 additions & 1 deletion src/display_manager.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
from rgbmatrix import RGBMatrix, RGBMatrixOptions
import os
if os.getenv("EMULATOR", "false") == "true":
from RGBMatrixEmulator import RGBMatrix, RGBMatrixOptions
else:
from rgbmatrix import RGBMatrix, RGBMatrixOptions
from PIL import Image, ImageDraw, ImageFont
import time
from typing import Dict, Any, List, Tuple
Expand Down
Loading