Files
LEDMatrix/config/config.template.json
Chuck ce79ccaec2 Feature/music skip delay (#115)
* feat: Add configurable delay for music module skip when nothing playing

- Add 'skip_when_nothing_playing' and 'skip_delay_seconds' config options
- Implement timer-based skip logic that waits 2 seconds before skipping
- Reset timer when music resumes or display is deactivated
- Improve user experience by preventing jarring immediate skips
- Maintains backward compatibility with existing configurations

* feat: Add live priority support to music manager

- Add 'live_priority' and 'live_game_duration' config options for music
- Integrate music manager into live priority rotation system
- Add 'music_live' mode that participates in live priority takeover
- Music manager joins live priority rotation when actively playing
- Supports future plugin ecosystem with consistent live priority interface
- Maintains backward compatibility with existing music configurations

* feat: Add new music settings to web interface

- Add 'Skip When Nothing Playing' checkbox and delay configuration
- Add 'Enable Live Priority' checkbox and duration configuration
- Update music form JavaScript to save all new settings
- Users can now configure music skip behavior and live priority through web UI

* fix: Improve music live priority integration

- Enhanced music live content detection with detailed logging
- Modified live priority logic to properly handle music mode
- Added music to live priority sports collection when actively playing
- Updated live priority rotation to handle music mode correctly
- Improved live priority takeover logic for music manager
- Music now properly participates in live priority rotation when playing

* perf: Reduce logging frequency for music live priority

- Add timestamp-based throttling to music live priority logging
- Info messages now only appear every 30 seconds instead of every few milliseconds
- Debug messages are also throttled to reduce log spam
- Maintains visibility of important events while reducing noise

* Fix unreachable code bug in music live priority handling

- Moved music live priority logic outside the sports iteration loop where it was unreachable
- The 'if sport == music' block was never executed since 'music' wasn't in the sports list
- Consolidated music handling in its own separate section for cleaner code structure
- Added music configuration options to config template
- Maintained exact same functionality while eliminating dead code

* Fix music_live_game_duration setting not being used

- Modified get_current_duration() method to check for music live priority mode
- When music is in live priority mode, use configured live_game_duration setting
- Added proper config reading for music_live_game_duration during initialization
- Ensures music displays for the configured duration when in live priority mode

* Fix stale timestamp bug in live priority debug logging

- Fixed issue where debug log at line 1240 was using a stale current_time variable
- The current_time variable was conditionally reassigned in music live priority check
- This caused inconsistent log throttling behavior
- Now uses fresh current_time_for_debug variable for accurate throttling
2025-10-16 16:46:37 -04:00

655 lines
18 KiB
JSON

{
"web_display_autostart": true,
"schedule": {
"enabled": true,
"start_time": "07:00",
"end_time": "23:00"
},
"timezone": "America/Chicago",
"location": {
"city": "Dallas",
"state": "Texas",
"country": "US"
},
"display": {
"hardware": {
"rows": 32,
"cols": 64,
"chain_length": 2,
"parallel": 1,
"brightness": 90,
"hardware_mapping": "adafruit-hat",
"scan_mode": 0,
"pwm_bits": 9,
"pwm_dither_bits": 1,
"pwm_lsb_nanoseconds": 130,
"disable_hardware_pulsing": false,
"inverse_colors": false,
"show_refresh_rate": false,
"limit_refresh_rate_hz": 100
},
"runtime": {
"gpio_slowdown": 3
},
"display_durations": {
"clock": 15,
"weather": 30,
"stocks": 30,
"hourly_forecast": 30,
"daily_forecast": 30,
"stock_news": 20,
"odds_ticker": 60,
"leaderboard": 300,
"nhl_live": 30,
"nhl_recent": 30,
"nhl_upcoming": 30,
"nba_live": 30,
"nba_recent": 30,
"nba_upcoming": 30,
"nfl_live": 30,
"nfl_recent": 30,
"nfl_upcoming": 30,
"ncaa_fb_live": 30,
"ncaa_fb_recent": 30,
"ncaa_fb_upcoming": 30,
"ncaa_baseball_live": 30,
"ncaa_baseball_recent": 30,
"ncaa_baseball_upcoming": 30,
"calendar": 30,
"youtube": 30,
"mlb_live": 30,
"mlb_recent": 30,
"mlb_upcoming": 30,
"milb_live": 30,
"milb_recent": 30,
"milb_upcoming": 30,
"text_display": 10,
"soccer_live": 30,
"soccer_recent": 30,
"soccer_upcoming": 30,
"ncaam_basketball_live": 30,
"ncaam_basketball_recent": 30,
"ncaam_basketball_upcoming": 30,
"music": 30,
"of_the_day": 40,
"news_manager": 60,
"static_image": 10
},
"use_short_date_format": true
},
"clock": {
"enabled": true,
"format": "%I:%M %p",
"update_interval": 1
},
"weather": {
"enabled": false,
"update_interval": 1800,
"units": "imperial",
"display_format": "{temp}°F\n{condition}"
},
"stocks": {
"enabled": false,
"update_interval": 600,
"scroll_speed": 1,
"scroll_delay": 0.01,
"toggle_chart": true,
"dynamic_duration": true,
"min_duration": 30,
"max_duration": 300,
"duration_buffer": 0.1,
"symbols": [
"ASTS",
"SCHD",
"INTC",
"NVDA",
"T",
"VOO",
"SMCI"
],
"display_format": "{symbol}: ${price} ({change}%)"
},
"crypto": {
"enabled": false,
"update_interval": 600,
"symbols": [
"BTC-USD",
"ETH-USD"
],
"display_format": "{symbol}: ${price} ({change}%)"
},
"stock_news": {
"enabled": false,
"update_interval": 3600,
"scroll_speed": 1,
"scroll_delay": 0.01,
"max_headlines_per_symbol": 1,
"headlines_per_rotation": 2,
"dynamic_duration": true,
"min_duration": 30,
"max_duration": 300,
"duration_buffer": 0.1
},
"odds_ticker": {
"enabled": false,
"show_favorite_teams_only": true,
"games_per_favorite_team": 1,
"max_games_per_league": 5,
"show_odds_only": false,
"sort_order": "soonest",
"enabled_leagues": [
"nfl",
"mlb",
"ncaa_fb",
"milb"
],
"update_interval": 3600,
"scroll_speed": 1,
"scroll_delay": 0.01,
"loop": true,
"future_fetch_days": 50,
"show_channel_logos": true,
"dynamic_duration": true,
"min_duration": 30,
"max_duration": 300,
"duration_buffer": 0.1
},
"leaderboard": {
"enabled": false,
"enabled_sports": {
"nfl": {
"enabled": true,
"top_teams": 10
},
"nba": {
"enabled": false,
"top_teams": 10
},
"mlb": {
"enabled": false,
"top_teams": 10
},
"ncaa_fb": {
"enabled": true,
"top_teams": 25,
"show_ranking": true
},
"nhl": {
"enabled": false,
"top_teams": 10
},
"ncaam_basketball": {
"enabled": false,
"top_teams": 25
},
"ncaam_hockey": {
"enabled": true,
"top_teams": 10,
"show_ranking": true
}
},
"update_interval": 3600,
"scroll_speed": 1,
"scroll_delay": 0.01,
"loop": false,
"request_timeout": 30,
"dynamic_duration": true,
"min_duration": 30,
"max_display_time": 600
},
"calendar": {
"enabled": false,
"credentials_file": "credentials.json",
"token_file": "token.pickle",
"update_interval": 3600,
"max_events": 3,
"calendars": [
"birthdays"
]
},
"nhl_scoreboard": {
"enabled": false,
"live_priority": true,
"live_game_duration": 20,
"show_odds": true,
"test_mode": false,
"update_interval_seconds": 3600,
"live_update_interval": 30,
"recent_update_interval": 3600,
"upcoming_update_interval": 3600,
"recent_games_to_show": 1,
"upcoming_games_to_show": 1,
"show_favorite_teams_only": true,
"show_all_live": false,
"show_shots_on_goal": false,
"favorite_teams": [
"TB"
],
"logo_dir": "assets/sports/nhl_logos",
"show_records": true,
"display_modes": {
"nhl_live": true,
"nhl_recent": true,
"nhl_upcoming": true
}
},
"nba_scoreboard": {
"enabled": false,
"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,
"recent_update_interval": 3600,
"upcoming_update_interval": 3600,
"recent_games_to_show": 1,
"upcoming_games_to_show": 1,
"show_favorite_teams_only": true,
"show_all_live": false,
"favorite_teams": [
"DAL"
],
"logo_dir": "assets/sports/nba_logos",
"show_records": true,
"display_modes": {
"nba_live": true,
"nba_recent": true,
"nba_upcoming": true
}
},
"wnba_scoreboard": {
"enabled": false,
"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,
"recent_update_interval": 3600,
"upcoming_update_interval": 3600,
"recent_games_to_show": 1,
"upcoming_games_to_show": 1,
"show_favorite_teams_only": true,
"show_all_live": false,
"favorite_teams": [
"CHI"
],
"logo_dir": "assets/sports/wnba_logos",
"show_records": true,
"display_modes": {
"wnba_live": true,
"wnba_recent": true,
"wnba_upcoming": true
}
},
"nfl_scoreboard": {
"enabled": false,
"live_priority": true,
"live_game_duration": 30,
"show_odds": true,
"test_mode": false,
"update_interval_seconds": 3600,
"live_update_interval": 30,
"live_odds_update_interval": 3600,
"odds_update_interval": 3600,
"recent_update_interval": 3600,
"upcoming_update_interval": 3600,
"recent_games_to_show": 1,
"upcoming_games_to_show": 1,
"show_favorite_teams_only": true,
"show_all_live": false,
"favorite_teams": [
"TB",
"DAL"
],
"logo_dir": "assets/sports/nfl_logos",
"show_records": true,
"display_modes": {
"nfl_live": true,
"nfl_recent": true,
"nfl_upcoming": true
}
},
"ncaa_fb_scoreboard": {
"enabled": false,
"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,
"recent_games_to_show": 1,
"upcoming_games_to_show": 1,
"show_favorite_teams_only": true,
"show_all_live": false,
"favorite_teams": [
"UGA",
"AP_TOP_25"
],
"logo_dir": "assets/sports/ncaa_logos",
"show_records": true,
"show_ranking": true,
"display_modes": {
"ncaa_fb_live": true,
"ncaa_fb_recent": true,
"ncaa_fb_upcoming": true
}
},
"ncaa_baseball_scoreboard": {
"enabled": false,
"live_priority": true,
"live_game_duration": 30,
"show_odds": true,
"test_mode": false,
"update_interval_seconds": 3600,
"live_update_interval": 30,
"recent_update_interval": 3600,
"upcoming_update_interval": 3600,
"recent_games_to_show": 1,
"upcoming_games_to_show": 1,
"show_favorite_teams_only": true,
"show_all_live": false,
"show_series_summary": false,
"favorite_teams": [
"UGA",
"AUB"
],
"logo_dir": "assets/sports/ncaa_logos",
"show_records": true,
"display_modes": {
"ncaa_baseball_live": true,
"ncaa_baseball_recent": true,
"ncaa_baseball_upcoming": true
}
},
"ncaam_basketball_scoreboard": {
"enabled": false,
"live_priority": true,
"live_game_duration": 20,
"show_odds": true,
"test_mode": false,
"update_interval_seconds": 3600,
"live_update_interval": 30,
"recent_games_to_show": 1,
"upcoming_games_to_show": 1,
"show_favorite_teams_only": true,
"show_all_live": false,
"favorite_teams": [
"UGA",
"AUB"
],
"logo_dir": "assets/sports/ncaa_logos",
"show_records": true,
"display_modes": {
"ncaam_basketball_live": true,
"ncaam_basketball_recent": true,
"ncaam_basketball_upcoming": true
}
},
"ncaaw_basketball_scoreboard": {
"enabled": false,
"live_priority": true,
"live_game_duration": 20,
"show_odds": true,
"test_mode": false,
"update_interval_seconds": 3600,
"live_update_interval": 30,
"recent_games_to_show": 1,
"upcoming_games_to_show": 1,
"show_favorite_teams_only": true,
"show_all_live": false,
"favorite_teams": [
"UGA",
"AUB"
],
"logo_dir": "assets/sports/ncaa_logos",
"show_records": true,
"display_modes": {
"ncaaw_basketball_live": true,
"ncaaw_basketball_recent": true,
"ncaaw_basketball_upcoming": true
}
},
"ncaam_hockey_scoreboard": {
"enabled": false,
"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,
"recent_games_to_show": 1,
"upcoming_games_to_show": 1,
"show_favorite_teams_only": true,
"show_all_live": false,
"show_shots_on_goal": false,
"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
}
},
"ncaaw_hockey_scoreboard": {
"enabled": false,
"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,
"recent_games_to_show": 1,
"upcoming_games_to_show": 1,
"show_favorite_teams_only": true,
"show_all_live": false,
"show_shots_on_goal": false,
"favorite_teams": [
"RIT"
],
"logo_dir": "assets/sports/ncaa_logos",
"show_records": false,
"show_ranking": false,
"display_modes": {
"ncaaw_hockey_live": true,
"ncaaw_hockey_recent": true ,
"ncaaw_hockey_upcoming": true
}
},
"youtube": {
"enabled": false,
"update_interval": 3600
},
"mlb_scoreboard": {
"enabled": false,
"live_priority": false,
"live_game_duration": 30,
"show_odds": true,
"test_mode": false,
"update_interval_seconds": 3600,
"live_update_interval": 30,
"live_odds_update_interval": 3600,
"odds_update_interval": 3600,
"recent_update_interval": 3600,
"upcoming_update_interval": 3600,
"recent_games_to_show": 1,
"upcoming_games_to_show": 1,
"show_favorite_teams_only": true,
"show_all_live": false,
"show_series_summary": false,
"favorite_teams": [
"TB",
"TEX"
],
"logo_dir": "assets/sports/mlb_logos",
"show_records": true,
"display_modes": {
"mlb_live": true,
"mlb_recent": true,
"mlb_upcoming": true
}
},
"milb_scoreboard": {
"enabled": false,
"live_priority": false,
"live_game_duration": 30,
"test_mode": false,
"update_interval_seconds": 3600,
"live_update_interval": 30,
"recent_update_interval": 3600,
"upcoming_update_interval": 3600,
"recent_games_to_show": 1,
"upcoming_games_to_show": 1,
"favorite_teams": [
"TAM"
],
"logo_dir": "assets/sports/milb_logos",
"show_records": true,
"upcoming_fetch_days": 7,
"display_modes": {
"milb_live": true,
"milb_recent": true,
"milb_upcoming": true
}
},
"text_display": {
"enabled": false,
"text": "Subscribe to ChuckBuilds",
"font_path": "assets/fonts/press-start-2p.ttf",
"font_size": 8,
"scroll": true,
"scroll_speed": 40,
"text_color": [
255,
0,
0
],
"background_color": [
0,
0,
0
],
"scroll_gap_width": 32
},
"soccer_scoreboard": {
"enabled": false,
"live_priority": true,
"live_game_duration": 30,
"show_odds": true,
"test_mode": false,
"update_interval_seconds": 3600,
"live_update_interval": 30,
"recent_update_interval": 3600,
"upcoming_update_interval": 3600,
"recent_games_to_show": 1,
"upcoming_games_to_show": 1,
"show_favorite_teams_only": true,
"favorite_teams": [
"DAL"
],
"leagues": [
"usa.1"
],
"logo_dir": "assets/sports/soccer_logos",
"show_records": true,
"display_modes": {
"soccer_live": true,
"soccer_recent": true,
"soccer_upcoming": true
}
},
"music": {
"enabled": false,
"preferred_source": "ytm",
"YTM_COMPANION_URL": "http://192.168.86.12:9863",
"POLLING_INTERVAL_SECONDS": 1,
"skip_when_nothing_playing": true,
"skip_delay_seconds": 2,
"live_priority": true,
"live_game_duration": 30
},
"of_the_day": {
"enabled": false,
"display_rotate_interval": 20,
"update_interval": 3600,
"subtitle_rotate_interval": 10,
"category_order": [
"word_of_the_day",
"slovenian_word_of_the_day"
],
"categories": {
"word_of_the_day": {
"enabled": true,
"data_file": "of_the_day/word_of_the_day.json",
"display_name": "Word of the Day"
},
"slovenian_word_of_the_day": {
"enabled": true,
"data_file": "of_the_day/slovenian_word_of_the_day.json",
"display_name": "Slovenian Word of the Day"
}
}
},
"news_manager": {
"enabled": false,
"update_interval": 300,
"scroll_speed": 1,
"scroll_delay": 0.01,
"headlines_per_feed": 2,
"enabled_feeds": [
"NFL",
"NCAA FB",
"F1",
"BBC F1"
],
"custom_feeds": {
"F1": "https://www.espn.com/espn/rss/rpm/news",
"BBC F1": "http://feeds.bbci.co.uk/sport/formula1/rss.xml"
},
"rotation_enabled": true,
"rotation_threshold": 3,
"dynamic_duration": true,
"min_duration": 30,
"max_duration": 300,
"duration_buffer": 0.1,
"font_size": 8,
"font_path": "assets/fonts/PressStart2P-Regular.ttf",
"text_color": [
255,
255,
255
],
"separator_color": [
255,
0,
0
]
},
"static_image": {
"enabled": false,
"image_path": "assets/static_images/default.png",
"fit_to_display": true,
"preserve_aspect_ratio": true,
"background_color": [
0,
0,
0
]
}
}