mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-12 05:42:59 +00:00
update display duration for of the day
This commit is contained in:
@@ -70,7 +70,7 @@
|
|||||||
"ncaam_basketball_recent": 30,
|
"ncaam_basketball_recent": 30,
|
||||||
"ncaam_basketball_upcoming": 30,
|
"ncaam_basketball_upcoming": 30,
|
||||||
"music": 30,
|
"music": 30,
|
||||||
"of_the_day": 30
|
"of_the_day": 60
|
||||||
},
|
},
|
||||||
"use_short_date_format": true
|
"use_short_date_format": true
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -303,7 +303,17 @@ class OfTheDayManager:
|
|||||||
self.last_drawn_day = None
|
self.last_drawn_day = None
|
||||||
# Handle OTD category rotation
|
# Handle OTD category rotation
|
||||||
if now - self.last_category_rotation_time > self.display_rotate_interval:
|
if now - self.last_category_rotation_time > self.display_rotate_interval:
|
||||||
|
# Find the next category with valid data
|
||||||
|
original_index = self.current_category_index
|
||||||
self.current_category_index = (self.current_category_index + 1) % len(self.current_items)
|
self.current_category_index = (self.current_category_index + 1) % len(self.current_items)
|
||||||
|
|
||||||
|
# If we've cycled through all categories and none have data, reset to first
|
||||||
|
if self.current_category_index == original_index:
|
||||||
|
logger.warning("No categories have valid data, staying on current category")
|
||||||
|
else:
|
||||||
|
logger.info(f"Rotating from category index {original_index} to {self.current_category_index}")
|
||||||
|
logger.info(f"Available categories with data: {list(self.current_items.keys())}")
|
||||||
|
|
||||||
self.last_category_rotation_time = now
|
self.last_category_rotation_time = now
|
||||||
# Reset subtitle/description rotation when switching category
|
# Reset subtitle/description rotation when switching category
|
||||||
self.rotation_state = 0
|
self.rotation_state = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user