mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-12 05:42:59 +00:00
remove dynamic duration calculation from startup loop
This commit is contained in:
@@ -476,7 +476,8 @@ class DisplayController:
|
|||||||
if self.youtube: self.youtube.update()
|
if self.youtube: self.youtube.update()
|
||||||
if self.text_display: self.text_display.update()
|
if self.text_display: self.text_display.update()
|
||||||
if self.of_the_day: self.of_the_day.update(time.time())
|
if self.of_the_day: self.of_the_day.update(time.time())
|
||||||
if self.news_manager: self.news_manager.fetch_news_data()
|
# News manager fetches data when displayed, not during updates
|
||||||
|
# if self.news_manager: self.news_manager.fetch_news_data()
|
||||||
|
|
||||||
# Update NHL managers
|
# Update NHL managers
|
||||||
if self.nhl_live: self.nhl_live.update()
|
if self.nhl_live: self.nhl_live.update()
|
||||||
|
|||||||
@@ -430,6 +430,10 @@ class NewsManager:
|
|||||||
self.display_manager.image = img
|
self.display_manager.image = img
|
||||||
self.display_manager.update_display()
|
self.display_manager.update_display()
|
||||||
|
|
||||||
|
# Debug: log scroll position
|
||||||
|
if hasattr(self, 'scroll_position') and hasattr(self, 'total_scroll_width'):
|
||||||
|
logger.debug(f"Scroll position: {self.scroll_position}/{self.total_scroll_width}")
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error in news display: {e}")
|
logger.error(f"Error in news display: {e}")
|
||||||
# Create error image
|
# Create error image
|
||||||
@@ -504,10 +508,5 @@ class NewsManager:
|
|||||||
|
|
||||||
def get_dynamic_duration(self) -> int:
|
def get_dynamic_duration(self) -> int:
|
||||||
"""Get the calculated dynamic duration for display"""
|
"""Get the calculated dynamic duration for display"""
|
||||||
# Ensure we have current data and calculated duration
|
# Return the current calculated duration without fetching data
|
||||||
if not self.cached_text or self.dynamic_duration == 60:
|
|
||||||
# Try to refresh if we don't have current data
|
|
||||||
if self.should_update() or not self.current_headlines:
|
|
||||||
self.fetch_news_data()
|
|
||||||
|
|
||||||
return self.dynamic_duration
|
return self.dynamic_duration
|
||||||
Reference in New Issue
Block a user