mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-11 13:23:00 +00:00
fix: force display updates for live NHL games when new data is received
This commit is contained in:
@@ -508,6 +508,7 @@ class NHLLiveManager(BaseNHLManager):
|
|||||||
self.current_game_index = 0 # Index to track which game to show
|
self.current_game_index = 0 # Index to track which game to show
|
||||||
self.last_game_switch = 0 # Track when we last switched games
|
self.last_game_switch = 0 # Track when we last switched games
|
||||||
self.game_display_duration = self.nhl_config.get("live_game_duration", 20) # Display each live game for 20 seconds
|
self.game_display_duration = self.nhl_config.get("live_game_duration", 20) # Display each live game for 20 seconds
|
||||||
|
self.last_display_update = 0 # Track when we last updated the display
|
||||||
|
|
||||||
# Initialize with test game only if test mode is enabled
|
# Initialize with test game only if test mode is enabled
|
||||||
if self.test_mode:
|
if self.test_mode:
|
||||||
@@ -594,6 +595,11 @@ class NHLLiveManager(BaseNHLManager):
|
|||||||
self.last_game_switch = current_time
|
self.last_game_switch = current_time
|
||||||
logging.info(f"[NHL] Switching to live game: {self.current_game['away_abbr']} vs {self.current_game['home_abbr']}")
|
logging.info(f"[NHL] Switching to live game: {self.current_game['away_abbr']} vs {self.current_game['home_abbr']}")
|
||||||
|
|
||||||
|
# Always update the display when we have new data
|
||||||
|
if self.current_game and current_time - self.last_display_update >= 1: # Update display at most once per second
|
||||||
|
self.display(force_clear=True)
|
||||||
|
self.last_display_update = current_time
|
||||||
|
|
||||||
def display(self, force_clear: bool = False):
|
def display(self, force_clear: bool = False):
|
||||||
"""Display live game information."""
|
"""Display live game information."""
|
||||||
if not self.current_game:
|
if not self.current_game:
|
||||||
|
|||||||
Reference in New Issue
Block a user