v2 Gambling Odds, WebUI, Improved Cache #8
ChuckBuilds
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Release vX.X: Odds, UI & Performance Overhaul
This release introduces a major new feature set centered around sports gambling odds, a powerful web-based UI for remote control, and significant architectural improvements to the caching system, API data fetching, and overall performance.
🔧 Breaking Changes & Required Setup
A new setup script has been added to handle permissions for the cache directory. When the application is run as a
systemdservice under theledpiuser, it often lacks the necessary permissions to write to cache directories located in the project root. This script resolves potentialPermissionDeniederrors.Execute the following command from the project root to apply the fix:
This script creates the
~/.ledmatrix_cachedirectory and sets the appropriate write permissions for the service user.✨ New Features & Technical Implementation
1. 🌐 Web-Based User Interface
A new, powerful web interface has been introduced, allowing for remote control of the LED Matrix directly from any web browser on the same network.
Flaskweb server (web_interface.py) runs on the Raspberry Pi, providing a simple yet effective UI.http://<your-pi-ip-address>:5000(ex 'http://ledpi:5000') in your web browser.2. Scrolling Odds Ticker (
OddsTickerManager)A new, highly configurable display module has been added to show a continuous scrolling ticker of upcoming games.
Pillow.Image) containing all game information. The scrolling effect is achieved by efficiently cropping and displaying a portion of this large image, which significantly improves performance and reduces CPU load.broadcastsarray from the ESPN API to display the logo of the broadcasting channel (e.g., ESPN, FOX, NBC). It has been updated to support the API's new data structure, which provides an array of broadcastnames. The implementation remains backward-compatible.3. Dedicated Odds Manager (
OddsManager)A new
OddsManagerclass now centralizes all logic for fetching and caching gambling odds.MLBManager,NFLManager, etc.), reducing code duplication and creating a single source of truth for odds data.sports.core.api.espn.com) to retrieve odds, which are often available even when the main scoreboard API does not include them.🚀 Architectural Improvements
1. Dynamic Caching Strategy (
CacheManager)The
CacheManagerhas been overhauled to use a more intelligent, dynamic TTL (Time-To-Live) strategy for scoreboard data.2. Day-by-Day Game Date Filtering
The logic for fetching upcoming games has been re-engineered for greater reliability.
now + timedelta) which could fail to capture games scheduled near midnight or across date boundaries.YYYYMMDDformatted date string. It fetches all games for each day up to thefuture_fetch_dayslimit defined in the config.3. Favorite Teams Enhancements & Display Modes
The logic for displaying games for favorite teams has been significantly improved, offering more granular control over what is shown on the screen for individual sports modules.
Personalized Ticker: The
odds_tickercan be configured viashow_favorite_teams_onlyto exclusively display upcoming games involving teams listed in the user's favorites. The `show_favorite_teams_only: false' toggle chews up a LOT more API calls and is not recommended. It is also a work in progress.Favorite Team Toggle (
show_favorite_teams_only): A flag has been implemented that applies to all individual scoreboard modules (nfl_scoreboard,mlb_scoreboard, etc.). Whenshow_favorite_teams_onlyis set totruein a scoreboard's configuration, that module will only display games (live, recent, or upcoming) that involve one of the teams in yourfavorite_teamslist. This provides a powerful way to filter out noise and focus only on the teams you care about for each sport. The "false" toggle chews up a LOT more API calls and is not recommended. It is also a work in progress.🎯 Focused Game Display Modes (
recent_games_to_show&upcoming_games_to_show):New configuration options have been introduced to control the behavior of the individual scoreboard modules. These settings allow for a focused, single-team display that can cycle through different states instead of time series collections of games. I.E. I want to see the last 3 NFL Team X's (Bucs) games instead of the last 21 days (3 weeks) of NFL Team X's(Bucs) Games.
upcoming_games_to_show: 1: Controls how many future games are displayed for a favorite team in its dedicated scoreboard view. When set to1, the module will display the single next scheduled game for that team.recent_games_to_show: 1: Controls how many past games are displayed. When set to1, the module will show the result of the most recently completed game for that team.These settings work together with the
display_modesconfiguration to create a rotational view of a team's status (e.g., show the live game if one is on; otherwise, cycle between showing the most recent result and the next upcoming game).🛠️ General Improvements & Fixes
MLB,NFL,NCAA, etc.) to be more efficient and consistent.config.jsonfor the new odds ticker and display modes.use_short_date_format): A new global configuration option,use_short_date_format: true, has been added under thedisplaysettings. When enabled, dates will be displayed in a more compact format (e.g.,Tue, 7/23instead ofTuesday, July 23). This helps to save valuable screen space on the matrix and provides a cleaner look.test_odds_ticker_broadcast.py,check_espn_api.py), and documentation to improve maintainability.This release represents a significant architectural enhancement, providing new, highly-requested features while improving the stability and efficiency of the existing codebase.
There were a lot of changes and I am sure there are bugs to be found. Reach out on Discord or create a ticket on Github.
Thanks for reading!
This discussion was created from the release v2 Gambling Odds, WebUI, Improved Cache.
Beta Was this translation helpful? Give feedback.
All reactions