Compare commits
236 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
711482d59a | ||
|
|
694c7cec10 | ||
|
|
bb76f01c05 | ||
|
|
3382cabe25 | ||
|
|
c06893f3e0 | ||
|
|
5c97b4baae | ||
|
|
cd0c43fb3a | ||
|
|
0a312cc912 | ||
|
|
0dc44c94b3 | ||
|
|
ce79ccaec2 | ||
|
|
9c313cdac3 | ||
|
|
ed22f5cd01 | ||
|
|
98d3ed7d91 | ||
|
|
584a4f258e | ||
|
|
7a61ecff7b | ||
|
|
58bbb5fe6f | ||
|
|
ee650820a9 | ||
|
|
fb38a5a814 | ||
|
|
3406234e00 | ||
|
|
9ba76b56d7 | ||
|
|
f3d02e07ea | ||
|
|
a115a1ed6b | ||
|
|
d83ff6a121 | ||
|
|
f6e2881f2f | ||
|
|
6c493e8329 | ||
|
|
e749925c0a | ||
|
|
f0b61e3bd9 | ||
|
|
83f76dbdce | ||
|
|
4adb7b49ba | ||
|
|
2d6c238ea0 | ||
|
|
e584026bda | ||
|
|
1b52928e1a | ||
|
|
38c1bff9dc | ||
|
|
08af182380 | ||
|
|
1ee805901f | ||
|
|
a98760f4d9 | ||
|
|
fc06493990 | ||
|
|
1bc4e531ae | ||
|
|
abceb8205c | ||
|
|
5bfcdaf4ff | ||
|
|
ad8a652183 | ||
|
|
76a9e98ba7 | ||
|
|
42e14f99b0 | ||
|
|
b1295047e2 | ||
|
|
7c18b5126e | ||
|
|
b792401e07 | ||
|
|
80a5e491ed | ||
|
|
635fd4de73 | ||
|
|
a08951ab56 | ||
|
|
1a746e965e | ||
|
|
8cbdef3949 | ||
|
|
569576d4e8 | ||
|
|
b0b5af8e21 | ||
|
|
cf15409973 | ||
|
|
1f2c1bfe0b | ||
|
|
8cad607d98 | ||
|
|
1dcda5613a | ||
|
|
31ec0018be | ||
|
|
86049ca679 | ||
|
|
9dc1118d79 | ||
|
|
6fcc93cab8 | ||
|
|
379e2c3714 | ||
|
|
3cbb32fec6 | ||
|
|
29ead0f7d9 | ||
|
|
7022a5c572 | ||
|
|
7ba7d5de13 | ||
|
|
007006feb2 | ||
|
|
b4b21604da | ||
|
|
688b09b95e | ||
|
|
e894c40ff4 | ||
|
|
a23a749c59 | ||
|
|
2d8f1b60a3 | ||
|
|
8c03e65104 | ||
|
|
764d80e818 | ||
|
|
854c236a60 | ||
|
|
4b1b343a8f | ||
|
|
65f04bff63 | ||
|
|
8055856137 | ||
|
|
17a79976dd | ||
|
|
38062d0bee | ||
|
|
2ce252059e | ||
|
|
c7ee946871 | ||
|
|
3afcbb759c | ||
|
|
bc18202736 | ||
|
|
a0973a2ad8 | ||
|
|
c18ab3f91f | ||
|
|
9718595017 | ||
|
|
5f803f346b | ||
|
|
0320830725 | ||
|
|
9dd744254a | ||
|
|
67b6a6fd68 | ||
|
|
ca62fd714f | ||
|
|
49346f9a6d | ||
|
|
9200c9cab3 | ||
|
|
dbdb730b4d | ||
|
|
91211d5c86 | ||
|
|
d78c592d6a | ||
|
|
4771ec8b3b | ||
|
|
60f68ff2a3 | ||
|
|
c7634cbf3a | ||
|
|
96cd383436 | ||
|
|
e39dd1e0a3 | ||
|
|
7b1339631c | ||
|
|
0579b3b860 | ||
|
|
e7e76eea4c | ||
|
|
3f431a54d4 | ||
|
|
d0f8785936 | ||
|
|
7618eafaa6 | ||
|
|
f8f4539015 | ||
|
|
0ab978d543 | ||
|
|
c4a51d0f80 | ||
|
|
b20c3880b2 | ||
|
|
652461a819 | ||
|
|
691d39675d | ||
|
|
9bc0cd5629 | ||
|
|
625a501da5 | ||
|
|
28c2dcd2f7 | ||
|
|
c55511c099 | ||
|
|
b96f1e3957 | ||
|
|
fcbc67464d | ||
|
|
4b36937a55 | ||
|
|
8ead8ad893 | ||
|
|
515ae2c7e9 | ||
|
|
a5a9398c5c | ||
|
|
b82e904cb1 | ||
|
|
fbff65fbad | ||
|
|
19edd9ace0 | ||
|
|
0982ef78dd | ||
|
|
5695d8e017 | ||
|
|
06ad446925 | ||
|
|
6b5a9cdff7 | ||
|
|
efb66118e4 | ||
|
|
2444aa2fc9 | ||
|
|
93f6173efa | ||
|
|
dc81d48ab1 | ||
|
|
5c32be929e | ||
|
|
105f60f57e | ||
|
|
a52130cedb | ||
|
|
d08e7953f2 | ||
|
|
d7544b04dd | ||
|
|
0291540df4 | ||
|
|
27b9b0267b | ||
|
|
cffef0d161 | ||
|
|
b5cb71b68d | ||
|
|
7685586508 | ||
|
|
b8aaa56b4b | ||
|
|
4aa307c8dd | ||
|
|
12b99024a4 | ||
|
|
22f0e29315 | ||
|
|
6eeba92350 | ||
|
|
286ba2b044 | ||
|
|
4b5a1e41d8 | ||
|
|
008705b75c | ||
|
|
5937f968ef | ||
|
|
4fe5547bf8 | ||
|
|
96f6749516 | ||
|
|
bc3883df14 | ||
|
|
32b1b8020a | ||
|
|
9280295ed3 | ||
|
|
e5a29d4668 | ||
|
|
4cfaa5ca59 | ||
|
|
6f894a587b | ||
|
|
35eb9cbdb5 | ||
|
|
2d41c5ca31 | ||
|
|
14f7a8b502 | ||
|
|
5101795cbf | ||
|
|
6d0632acee | ||
|
|
9298eff554 | ||
|
|
335ab8cce0 | ||
|
|
32daced427 | ||
|
|
153edcc2e1 | ||
|
|
548bc00e00 | ||
|
|
f8ab022da9 | ||
|
|
cd80745dcb | ||
|
|
56dfbda40a | ||
|
|
591555c3c7 | ||
|
|
bbabad3135 | ||
|
|
3329822a46 | ||
|
|
413a1fa38c | ||
|
|
3ee7821353 | ||
|
|
20a816f3e6 | ||
|
|
457f9f9eb5 | ||
|
|
39519dbfff | ||
|
|
61a56560f3 | ||
|
|
c1ccd6f44a | ||
|
|
2123f78dad | ||
|
|
a1914980c8 | ||
|
|
a3dbc6a4a8 | ||
|
|
8a0fdb005d | ||
|
|
f13ad238eb | ||
|
|
92071237c1 | ||
|
|
52c2d61dcf | ||
|
|
73036c33cb | ||
|
|
d6eb7a778c | ||
|
|
62b50cc06f | ||
|
|
05bee6ce84 | ||
|
|
2c2d24c0a8 | ||
|
|
b252229e03 | ||
|
|
8f7aeee546 | ||
|
|
b7fa2f1df6 | ||
|
|
ba3b79dd72 | ||
|
|
e4e058ff97 | ||
|
|
0b42cec902 | ||
|
|
35ad842ba1 | ||
|
|
08cf4152f7 | ||
|
|
71a392737e | ||
|
|
2b93eafcdf | ||
|
|
3c1706d4e8 | ||
|
|
e4b3adb867 | ||
|
|
9f00124fad | ||
|
|
68416d0293 | ||
|
|
e63198dc49 | ||
|
|
a5ce721733 | ||
|
|
e3b65588a2 | ||
|
|
f13e9306c9 | ||
|
|
ef82610a06 | ||
|
|
18145edbf1 | ||
|
|
54635fee3c | ||
|
|
6152969340 | ||
|
|
8770e5a327 | ||
|
|
822d9909ed | ||
|
|
d179700c6c | ||
|
|
dfecc6f8a0 | ||
|
|
0d8d4084a9 | ||
|
|
6bc1039ed6 | ||
|
|
8e1b04550b | ||
|
|
33e1f05f77 | ||
|
|
c4113367f7 | ||
|
|
4b906b3a92 | ||
|
|
06d8360922 | ||
|
|
9d4082665a | ||
|
|
a3481f3674 | ||
|
|
e36d92340e | ||
|
|
6225189b3c | ||
|
|
6c658c23c4 | ||
|
|
30cf8ee2e8 |
38
.cursor/rules/coding-standards.mdc
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
---
|
||||||
|
globs: *.py
|
||||||
|
---
|
||||||
|
|
||||||
|
# Python Coding Standards
|
||||||
|
|
||||||
|
## Code Quality Principles
|
||||||
|
- **Simplicity First**: Prefer clear, readable code over clever optimizations
|
||||||
|
- **Explicit over Implicit**: Make intentions clear through naming and structure
|
||||||
|
- **Fail Fast**: Validate inputs and handle errors early
|
||||||
|
- **Documentation**: Use docstrings for classes and complex functions
|
||||||
|
|
||||||
|
## Naming Conventions
|
||||||
|
- **Classes**: PascalCase (e.g., `NHLRecentManager`)
|
||||||
|
- **Functions/Variables**: snake_case (e.g., `fetch_game_data`)
|
||||||
|
- **Constants**: UPPER_SNAKE_CASE (e.g., `ESPN_NHL_SCOREBOARD_URL`)
|
||||||
|
- **Private methods**: Leading underscore (e.g., `_fetch_data`)
|
||||||
|
|
||||||
|
## Error Handling
|
||||||
|
- **Logging**: Use structured logging with context (e.g., `[NHL Recent]`)
|
||||||
|
- **Exceptions**: Catch specific exceptions, not bare `except:`
|
||||||
|
- **User-friendly messages**: Explain what went wrong and potential solutions
|
||||||
|
- **Graceful degradation**: Continue operation when non-critical features fail
|
||||||
|
|
||||||
|
## Manager Pattern
|
||||||
|
All sports managers should follow this structure:
|
||||||
|
```python
|
||||||
|
class BaseManager:
|
||||||
|
def __init__(self, config, display_manager, cache_manager)
|
||||||
|
def update(self) # Fetch and process data
|
||||||
|
def display(self, force_clear=False) # Render to display
|
||||||
|
```
|
||||||
|
|
||||||
|
## Configuration Management
|
||||||
|
- **Type hints**: Use for function parameters and return values
|
||||||
|
- **Configuration validation**: Check required fields on initialization
|
||||||
|
- **Default values**: Provide sensible defaults in code, not config
|
||||||
|
- **Environment awareness**: Handle different deployment contexts
|
||||||
42
.cursor/rules/configuration-management.mdc
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
---
|
||||||
|
globs: config/*.json,src/*.py
|
||||||
|
---
|
||||||
|
|
||||||
|
# Configuration Management
|
||||||
|
|
||||||
|
## Configuration Structure
|
||||||
|
- **Main config**: [config/config.json](mdc:config/config.json) - Primary configuration
|
||||||
|
- **Secrets**: [config/config_secrets.json](mdc:config/config_secrets.json) - API keys and sensitive data
|
||||||
|
- **Templates**: [config/config.template.json](mdc:config/config.template.json) - Default values
|
||||||
|
|
||||||
|
## Configuration Principles
|
||||||
|
- **Validation**: Check required fields and data types on startup
|
||||||
|
- **Defaults**: Provide sensible defaults in code, not just config
|
||||||
|
- **Environment awareness**: Handle development vs production differences
|
||||||
|
- **Security**: Never commit secrets to version control
|
||||||
|
|
||||||
|
## Manager Configuration Pattern
|
||||||
|
```python
|
||||||
|
def __init__(self, config, display_manager, cache_manager):
|
||||||
|
self.mode_config = config.get("sport_scoreboard", {})
|
||||||
|
self.favorite_teams = self.mode_config.get("favorite_teams", [])
|
||||||
|
self.show_favorite_only = self.mode_config.get("show_favorite_teams_only", False)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Required Configuration Sections
|
||||||
|
- **Display settings**: Update intervals, display durations
|
||||||
|
- **API settings**: Timeouts, retry logic, rate limiting
|
||||||
|
- **Background service**: Threading, caching, priority settings
|
||||||
|
- **Team preferences**: Favorite teams, filtering options
|
||||||
|
|
||||||
|
## Configuration Validation
|
||||||
|
- **Type checking**: Ensure numeric values are numbers, lists are lists
|
||||||
|
- **Range validation**: Check that intervals are reasonable
|
||||||
|
- **Dependency checking**: Verify required services are available
|
||||||
|
- **Fallback values**: Provide defaults when config is missing or invalid
|
||||||
|
|
||||||
|
## Best Practices
|
||||||
|
- **Documentation**: Comment complex configuration options
|
||||||
|
- **Examples**: Provide working examples in templates
|
||||||
|
- **Migration**: Handle configuration changes between versions
|
||||||
|
- **Testing**: Validate configuration in test environments
|
||||||
50
.cursor/rules/error-handling-logging.mdc
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
---
|
||||||
|
globs: src/*.py
|
||||||
|
---
|
||||||
|
|
||||||
|
# Error Handling and Logging
|
||||||
|
|
||||||
|
## Logging Standards
|
||||||
|
- **Structured prefixes**: Use consistent tags like `[NHL Recent]`, `[NFL Live]`
|
||||||
|
- **Context information**: Include relevant details (team names, game status, dates)
|
||||||
|
- **Appropriate levels**:
|
||||||
|
- `info`: Normal operations and status updates
|
||||||
|
- `debug`: Detailed information for troubleshooting
|
||||||
|
- `warning`: Non-critical issues that should be noted
|
||||||
|
- `error`: Problems that need attention
|
||||||
|
|
||||||
|
## Error Handling Patterns
|
||||||
|
```python
|
||||||
|
try:
|
||||||
|
data = self._fetch_data()
|
||||||
|
if not data or 'events' not in data:
|
||||||
|
self.logger.warning("[Manager] No events found in API response")
|
||||||
|
return
|
||||||
|
except requests.exceptions.RequestException as e:
|
||||||
|
self.logger.error(f"[Manager] API error: {e}")
|
||||||
|
return None
|
||||||
|
```
|
||||||
|
|
||||||
|
## User-Friendly Messages
|
||||||
|
- **Explain the situation**: "No games available during off-season"
|
||||||
|
- **Provide context**: "NHL season typically runs October-June"
|
||||||
|
- **Suggest solutions**: "Check back when season starts"
|
||||||
|
- **Distinguish issues**: API problems vs no data vs filtering results
|
||||||
|
|
||||||
|
## Graceful Degradation
|
||||||
|
- **Fallback content**: Show alternative games when favorites unavailable
|
||||||
|
- **Cached data**: Use cached data when API fails
|
||||||
|
- **Service continuity**: Continue operation when non-critical features fail
|
||||||
|
- **Clear communication**: Explain what's happening to users
|
||||||
|
|
||||||
|
## Debugging Support
|
||||||
|
- **Comprehensive logging**: Log API responses, filtering results, display updates
|
||||||
|
- **State tracking**: Log current state and transitions
|
||||||
|
- **Performance monitoring**: Track timing and resource usage
|
||||||
|
- **Error context**: Include stack traces for debugging
|
||||||
|
|
||||||
|
## Off-Season Awareness
|
||||||
|
- **Seasonal messaging**: Different messages for different times of year
|
||||||
|
- **Helpful context**: Explain why no games are available
|
||||||
|
- **Future planning**: Mention when season starts
|
||||||
|
- **Realistic expectations**: Set appropriate expectations during off-season
|
||||||
51
.cursor/rules/git-workflow.mdc
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
---
|
||||||
|
alwaysApply: true
|
||||||
|
---
|
||||||
|
|
||||||
|
# Git Workflow and Branching
|
||||||
|
|
||||||
|
## Branch Naming Conventions
|
||||||
|
- **Features**: `feature/description-of-feature` (e.g., `feature/weather-forecast-improvements`)
|
||||||
|
- **Bug fixes**: `fix/description-of-bug` (e.g., `fix/nhl-manager-improvements`)
|
||||||
|
- **Hotfixes**: `hotfix/critical-issue-description`
|
||||||
|
- **Refactoring**: `refactor/description-of-refactor`
|
||||||
|
|
||||||
|
## Commit Message Format
|
||||||
|
```
|
||||||
|
type(scope): description
|
||||||
|
|
||||||
|
[optional body]
|
||||||
|
|
||||||
|
[optional footer]
|
||||||
|
```
|
||||||
|
|
||||||
|
**Types**: feat, fix, docs, style, refactor, test, chore
|
||||||
|
**Examples**:
|
||||||
|
- `feat(nhl): Add enhanced logging for data visibility`
|
||||||
|
- `fix(display): Resolve rendering performance issue`
|
||||||
|
- `docs(api): Update ESPN API integration guide`
|
||||||
|
|
||||||
|
## Pull Request Guidelines
|
||||||
|
- **Self-review**: Review your own PR before requesting review
|
||||||
|
- **Testing**: Test thoroughly on Raspberry Pi hardware
|
||||||
|
- **Documentation**: Update relevant documentation if needed
|
||||||
|
- **Clean history**: Squash commits if necessary for clean history
|
||||||
|
|
||||||
|
## Code Review Checklist
|
||||||
|
- **Code Quality**: Proper error handling, logging, type hints
|
||||||
|
- **Architecture**: Follows project patterns, doesn't break existing functionality
|
||||||
|
- **Performance**: No negative impact on display performance
|
||||||
|
- **Testing**: Works on Raspberry Pi hardware
|
||||||
|
- **Documentation**: Comments added for complex logic
|
||||||
|
|
||||||
|
## Merge Strategies
|
||||||
|
- **Squash and Merge**: Preferred for feature branches and bug fixes
|
||||||
|
- **Merge Commit**: For complex features with multiple logical commits
|
||||||
|
- **Rebase and Merge**: For simple, single-commit changes
|
||||||
|
|
||||||
|
## Best Practices
|
||||||
|
- **Keep branches small and focused**
|
||||||
|
- **Commit frequently with meaningful messages**
|
||||||
|
- **Update branch regularly with main**
|
||||||
|
- **Test changes incrementally**
|
||||||
|
- **Delete feature branches after merge**
|
||||||
213
.cursor/rules/github-branches-rule.mdc
Normal file
@@ -0,0 +1,213 @@
|
|||||||
|
---
|
||||||
|
description: GitHub branching and pull request best practices for LEDMatrix project
|
||||||
|
globs: ["**/*.py", "**/*.md", "**/*.json", "**/*.sh"]
|
||||||
|
alwaysApply: true
|
||||||
|
---
|
||||||
|
|
||||||
|
# GitHub Branching and Pull Request Guidelines
|
||||||
|
|
||||||
|
## Branch Naming Conventions
|
||||||
|
|
||||||
|
### Feature Branches
|
||||||
|
- **Format**: `feature/description-of-feature`
|
||||||
|
- **Examples**:
|
||||||
|
- `feature/weather-forecast-improvements`
|
||||||
|
- `feature/stock-api-integration`
|
||||||
|
- `feature/nba-live-scores`
|
||||||
|
|
||||||
|
### Bug Fix Branches
|
||||||
|
- **Format**: `fix/description-of-bug`
|
||||||
|
- **Examples**:
|
||||||
|
- `fix/leaderboard-scrolling-performance`
|
||||||
|
- `fix/weather-api-timeout`
|
||||||
|
- `fix/display-rendering-issue`
|
||||||
|
|
||||||
|
### Hotfix Branches
|
||||||
|
- **Format**: `hotfix/critical-issue-description`
|
||||||
|
- **Examples**:
|
||||||
|
- `hotfix/display-crash-fix`
|
||||||
|
- `hotfix/api-rate-limit-fix`
|
||||||
|
|
||||||
|
### Refactoring Branches
|
||||||
|
- **Format**: `refactor/description-of-refactor`
|
||||||
|
- **Examples**:
|
||||||
|
- `refactor/sports-manager-architecture`
|
||||||
|
- `refactor/cache-management-system`
|
||||||
|
|
||||||
|
## Branch Management Rules
|
||||||
|
|
||||||
|
### Main Branch Protection
|
||||||
|
- **`main`** branch is protected and requires PR reviews
|
||||||
|
- Never commit directly to `main`
|
||||||
|
- All changes must go through pull requests
|
||||||
|
|
||||||
|
### Branch Lifecycle
|
||||||
|
1. **Create** branch from `main` when starting work
|
||||||
|
2. **Keep** branch up-to-date with `main` regularly
|
||||||
|
3. **Test** thoroughly before creating PR
|
||||||
|
4. **Delete** branch after successful merge
|
||||||
|
|
||||||
|
### Branch Updates
|
||||||
|
```bash
|
||||||
|
# Before starting new work
|
||||||
|
git checkout main
|
||||||
|
git pull origin main
|
||||||
|
|
||||||
|
# Create new branch
|
||||||
|
git checkout -b feature/your-feature-name
|
||||||
|
|
||||||
|
# Keep branch updated during development
|
||||||
|
git checkout main
|
||||||
|
git pull origin main
|
||||||
|
git checkout feature/your-feature-name
|
||||||
|
git merge main
|
||||||
|
```
|
||||||
|
|
||||||
|
## Pull Request Guidelines
|
||||||
|
|
||||||
|
### PR Title Format
|
||||||
|
- **Feature**: `feat: Add weather forecast improvements`
|
||||||
|
- **Fix**: `fix: Resolve leaderboard scrolling performance issue`
|
||||||
|
- **Refactor**: `refactor: Improve sports manager architecture`
|
||||||
|
- **Docs**: `docs: Update API integration guide`
|
||||||
|
- **Test**: `test: Add unit tests for weather manager`
|
||||||
|
|
||||||
|
### PR Description Template
|
||||||
|
```markdown
|
||||||
|
## Description
|
||||||
|
Brief description of changes and motivation.
|
||||||
|
|
||||||
|
## Type of Change
|
||||||
|
- [ ] Bug fix (non-breaking change)
|
||||||
|
- [ ] New feature (non-breaking change)
|
||||||
|
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
||||||
|
- [ ] Documentation update
|
||||||
|
- [ ] Performance improvement
|
||||||
|
- [ ] Refactoring
|
||||||
|
|
||||||
|
## Testing
|
||||||
|
- [ ] Tested on Raspberry Pi hardware
|
||||||
|
- [ ] Verified display rendering works correctly
|
||||||
|
- [ ] Checked API integration functionality
|
||||||
|
- [ ] Tested error handling scenarios
|
||||||
|
|
||||||
|
## Screenshots/Videos
|
||||||
|
(If applicable, add screenshots or videos of the changes)
|
||||||
|
|
||||||
|
## Checklist
|
||||||
|
- [ ] Code follows project style guidelines
|
||||||
|
- [ ] Self-review completed
|
||||||
|
- [ ] Comments added for complex logic
|
||||||
|
- [ ] No hardcoded values or API keys
|
||||||
|
- [ ] Error handling implemented
|
||||||
|
- [ ] Logging added where appropriate
|
||||||
|
```
|
||||||
|
|
||||||
|
### PR Review Requirements
|
||||||
|
|
||||||
|
#### For Reviewers
|
||||||
|
- **Code Quality**: Check for proper error handling, logging, and type hints
|
||||||
|
- **Architecture**: Ensure changes follow project patterns and don't break existing functionality
|
||||||
|
- **Performance**: Verify changes don't negatively impact display performance
|
||||||
|
- **Testing**: Confirm changes work on Raspberry Pi hardware
|
||||||
|
- **Documentation**: Check if documentation needs updates
|
||||||
|
|
||||||
|
#### For Authors
|
||||||
|
- **Self-Review**: Review your own PR before requesting review
|
||||||
|
- **Testing**: Test thoroughly on Pi hardware before submitting
|
||||||
|
- **Documentation**: Update relevant documentation if needed
|
||||||
|
- **Clean History**: Squash commits if necessary for clean history
|
||||||
|
|
||||||
|
## Commit Message Guidelines
|
||||||
|
|
||||||
|
### Format
|
||||||
|
```
|
||||||
|
type(scope): description
|
||||||
|
|
||||||
|
[optional body]
|
||||||
|
|
||||||
|
[optional footer]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Types
|
||||||
|
- **feat**: New feature
|
||||||
|
- **fix**: Bug fix
|
||||||
|
- **docs**: Documentation changes
|
||||||
|
- **style**: Code style changes (formatting, etc.)
|
||||||
|
- **refactor**: Code refactoring
|
||||||
|
- **test**: Adding or updating tests
|
||||||
|
- **chore**: Maintenance tasks
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
```
|
||||||
|
feat(weather): Add hourly forecast display
|
||||||
|
fix(nba): Resolve live score update issue
|
||||||
|
docs(api): Update ESPN API integration guide
|
||||||
|
refactor(sports): Improve base class architecture
|
||||||
|
```
|
||||||
|
|
||||||
|
## Merge Strategies
|
||||||
|
|
||||||
|
### Squash and Merge (Preferred)
|
||||||
|
- Use for feature branches and bug fixes
|
||||||
|
- Creates clean, linear history
|
||||||
|
- Combines all commits into single commit
|
||||||
|
|
||||||
|
### Merge Commit
|
||||||
|
- Use for complex features with multiple logical commits
|
||||||
|
- Preserves commit history
|
||||||
|
- Use when commit messages are meaningful
|
||||||
|
|
||||||
|
### Rebase and Merge
|
||||||
|
- Use sparingly for simple, single-commit changes
|
||||||
|
- Creates linear history without merge commits
|
||||||
|
|
||||||
|
## Release Management
|
||||||
|
|
||||||
|
### Version Tags
|
||||||
|
- Use semantic versioning: `v1.2.3`
|
||||||
|
- Tag releases on `main` branch
|
||||||
|
- Create release notes with technical details
|
||||||
|
|
||||||
|
### Release Branches
|
||||||
|
- **Format**: `release/v1.2.3`
|
||||||
|
- Use for release preparation
|
||||||
|
- Include version bumps and final testing
|
||||||
|
|
||||||
|
## Emergency Procedures
|
||||||
|
|
||||||
|
### Hotfix Process
|
||||||
|
1. Create `hotfix/` branch from `main`
|
||||||
|
2. Make minimal fix
|
||||||
|
3. Test thoroughly
|
||||||
|
4. Create PR with expedited review
|
||||||
|
5. Merge to `main` and tag release
|
||||||
|
6. Cherry-pick to other branches if needed
|
||||||
|
|
||||||
|
### Rollback Process
|
||||||
|
1. Identify last known good commit
|
||||||
|
2. Create revert PR if possible
|
||||||
|
3. Use `git revert` for clean rollback
|
||||||
|
4. Tag rollback release
|
||||||
|
5. Document issue and resolution
|
||||||
|
|
||||||
|
## Best Practices
|
||||||
|
|
||||||
|
### Before Creating PR
|
||||||
|
- [ ] Run all tests locally
|
||||||
|
- [ ] Test on Raspberry Pi hardware
|
||||||
|
- [ ] Check for linting errors
|
||||||
|
- [ ] Update documentation if needed
|
||||||
|
- [ ] Ensure commit messages are clear
|
||||||
|
|
||||||
|
### During Development
|
||||||
|
- [ ] Keep branches small and focused
|
||||||
|
- [ ] Commit frequently with meaningful messages
|
||||||
|
- [ ] Update branch regularly with main
|
||||||
|
- [ ] Test changes incrementally
|
||||||
|
|
||||||
|
### After PR Approval
|
||||||
|
- [ ] Delete feature branch after merge
|
||||||
|
- [ ] Update local main branch
|
||||||
|
- [ ] Verify changes work in production
|
||||||
|
- [ ] Update any related documentation
|
||||||
23
.cursor/rules/project-structure.mdc
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
---
|
||||||
|
alwaysApply: true
|
||||||
|
---
|
||||||
|
|
||||||
|
# LEDMatrix Project Structure
|
||||||
|
|
||||||
|
## Core Architecture
|
||||||
|
- **Main entry point**: [run.py](mdc:run.py) - Primary application launcher
|
||||||
|
- **Configuration**: [config/config.json](mdc:config/config.json) - Main configuration file
|
||||||
|
- **Display management**: [src/display_controller.py](mdc:src/display_controller.py) - Core display logic
|
||||||
|
- **Web interface**: [web_interface_v2.py](mdc:web_interface_v2.py) - Modern web UI
|
||||||
|
|
||||||
|
## Source Code Organization
|
||||||
|
- **Managers**: [src/](mdc:src/) - All sports/weather/stock managers
|
||||||
|
- **Assets**: [assets/](mdc:assets/) - Logos, fonts, and static resources
|
||||||
|
- **Tests**: [test/](mdc:test/) - Unit and integration tests
|
||||||
|
- **Documentation**: [LEDMatrix.wiki/](mdc:LEDMatrix.wiki/) - Comprehensive guides
|
||||||
|
|
||||||
|
## Key Design Principles
|
||||||
|
- **Single Responsibility**: Each manager handles one sport/domain
|
||||||
|
- **Consistent Patterns**: All managers follow similar structure
|
||||||
|
- **Configuration-Driven**: Behavior controlled via [config/config.json](mdc:config/config.json)
|
||||||
|
- **Raspberry Pi Focus**: Optimized for Pi hardware, not Windows development
|
||||||
41
.cursor/rules/raspberry-pi-development.mdc
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
---
|
||||||
|
alwaysApply: true
|
||||||
|
---
|
||||||
|
|
||||||
|
# Raspberry Pi Development Guidelines
|
||||||
|
|
||||||
|
## Hardware Constraints
|
||||||
|
- **Pi-only execution**: Code must run on Raspberry Pi, not Windows development machine
|
||||||
|
- **LED matrix library**: Uses [rpi-rgb-led-matrix-master/](mdc:rpi-rgb-led-matrix-master/) for hardware control
|
||||||
|
- **Memory limitations**: Optimize for Pi's limited RAM
|
||||||
|
- **Performance**: Consider Pi's CPU capabilities in design
|
||||||
|
|
||||||
|
## Development Workflow
|
||||||
|
- **Local development**: Write and test code on Windows
|
||||||
|
- **Pi deployment**: Deploy and test on actual Pi hardware
|
||||||
|
- **SSH access**: Use SSH for Pi-based testing and debugging
|
||||||
|
- **Service management**: Use systemd services for production deployment
|
||||||
|
|
||||||
|
## Testing Strategy
|
||||||
|
- **Unit tests**: Test logic without hardware dependencies
|
||||||
|
- **Integration tests**: Test with mock display managers
|
||||||
|
- **Hardware tests**: Validate on actual Pi with LED matrix
|
||||||
|
- **Performance tests**: Monitor memory and CPU usage
|
||||||
|
|
||||||
|
## Deployment Considerations
|
||||||
|
- **Service files**: [ledmatrix.service](mdc:ledmatrix.service), [ledmatrix-web.service](mdc:ledmatrix-web.service)
|
||||||
|
- **Installation scripts**: [first_time_install.sh](mdc:first_time_install.sh), [install_service.sh](mdc:install_service.sh)
|
||||||
|
- **Dependencies**: [requirements.txt](mdc:requirements.txt) for Pi environment
|
||||||
|
- **Permissions**: Handle file permissions for Pi user
|
||||||
|
|
||||||
|
## Performance Optimization
|
||||||
|
- **Caching**: Use [src/cache_manager.py](mdc:src/cache_manager.py) for data persistence
|
||||||
|
- **Background services**: Non-blocking data fetching
|
||||||
|
- **Memory management**: Clean up resources regularly
|
||||||
|
- **Display optimization**: Minimize unnecessary redraws
|
||||||
|
|
||||||
|
## Debugging on Pi
|
||||||
|
- **Logging**: Comprehensive logging for remote debugging
|
||||||
|
- **Error reporting**: Clear error messages for troubleshooting
|
||||||
|
- **Status monitoring**: Health checks and status reporting
|
||||||
|
- **Remote access**: Web interface for configuration and monitoring
|
||||||
42
.cursor/rules/sports-managers.mdc
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
---
|
||||||
|
globs: src/*_managers.py
|
||||||
|
---
|
||||||
|
|
||||||
|
# Sports Manager Development
|
||||||
|
|
||||||
|
## Manager Architecture
|
||||||
|
All sports managers inherit from base classes and follow consistent patterns:
|
||||||
|
- **Base classes**: [src/nhl_managers.py](mdc:src/nhl_managers.py), [src/nfl_managers.py](mdc:src/nfl_managers.py)
|
||||||
|
- **Common functionality**: Data fetching, caching, display rendering
|
||||||
|
- **Configuration-driven**: Behavior controlled via config sections
|
||||||
|
|
||||||
|
## Required Methods
|
||||||
|
```python
|
||||||
|
def __init__(self, config, display_manager, cache_manager)
|
||||||
|
def update(self) # Fetch fresh data
|
||||||
|
def display(self, force_clear=False) # Render current data
|
||||||
|
```
|
||||||
|
|
||||||
|
## Data Flow Pattern
|
||||||
|
1. **Fetch**: Get data from API (with caching)
|
||||||
|
2. **Process**: Extract relevant game information
|
||||||
|
3. **Filter**: Apply favorite team preferences
|
||||||
|
4. **Display**: Render to LED matrix
|
||||||
|
|
||||||
|
## Logging Standards
|
||||||
|
- **Structured prefixes**: `[NHL Recent]`, `[NFL Live]`, etc.
|
||||||
|
- **Context information**: Include team names, game status, dates
|
||||||
|
- **Debug levels**: Use appropriate log levels (info, debug, warning, error)
|
||||||
|
- **User-friendly messages**: Explain what's happening and why
|
||||||
|
|
||||||
|
## Error Handling
|
||||||
|
- **API failures**: Log and continue with cached data if available
|
||||||
|
- **No data scenarios**: Distinguish between API issues vs no games available
|
||||||
|
- **Off-season awareness**: Provide helpful context during non-active periods
|
||||||
|
- **Fallback behavior**: Show alternative content when preferred content unavailable
|
||||||
|
|
||||||
|
## Configuration Integration
|
||||||
|
- **Required settings**: Validate on initialization
|
||||||
|
- **Optional settings**: Provide sensible defaults
|
||||||
|
- **Background service**: Use for non-blocking data fetching
|
||||||
|
- **Caching strategy**: Implement intelligent cache management
|
||||||
51
.cursor/rules/testing-standards.mdc
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
---
|
||||||
|
globs: test/*.py,src/*.py
|
||||||
|
---
|
||||||
|
|
||||||
|
# Testing Standards
|
||||||
|
|
||||||
|
## Test Organization
|
||||||
|
- **Test directory**: [test/](mdc:test/) - All test files
|
||||||
|
- **Unit tests**: Test individual components in isolation
|
||||||
|
- **Integration tests**: Test component interactions
|
||||||
|
- **Hardware tests**: Validate on Raspberry Pi with actual LED matrix
|
||||||
|
|
||||||
|
## Testing Principles
|
||||||
|
- **Test behavior, not implementation**: Focus on what the code does, not how
|
||||||
|
- **Mock external dependencies**: Use mocks for APIs, display managers, cache
|
||||||
|
- **Test edge cases**: Empty data, API failures, configuration errors
|
||||||
|
- **Pi-specific testing**: Validate hardware integration
|
||||||
|
|
||||||
|
## Test Structure
|
||||||
|
```python
|
||||||
|
def test_manager_initialization():
|
||||||
|
"""Test that manager initializes with valid config"""
|
||||||
|
config = {"sport_scoreboard": {"enabled": True}}
|
||||||
|
manager = ManagerClass(config, mock_display, mock_cache)
|
||||||
|
assert manager.enabled == True
|
||||||
|
|
||||||
|
def test_api_failure_handling():
|
||||||
|
"""Test graceful handling of API failures"""
|
||||||
|
# Test that system continues when API fails
|
||||||
|
# Verify fallback to cached data
|
||||||
|
# Check appropriate error logging
|
||||||
|
```
|
||||||
|
|
||||||
|
## Mock Patterns
|
||||||
|
- **Display Manager**: Mock for testing without hardware
|
||||||
|
- **Cache Manager**: Mock for testing data persistence
|
||||||
|
- **API responses**: Mock for consistent test data
|
||||||
|
- **Configuration**: Use test-specific configs
|
||||||
|
|
||||||
|
## Test Categories
|
||||||
|
- **Unit tests**: Individual manager methods
|
||||||
|
- **Integration tests**: Manager interactions with services
|
||||||
|
- **Configuration tests**: Validate config loading and validation
|
||||||
|
- **Error handling tests**: API failures, invalid data, edge cases
|
||||||
|
|
||||||
|
## Testing Best Practices
|
||||||
|
- **Descriptive names**: Test names should explain what they test
|
||||||
|
- **Single responsibility**: Each test should verify one thing
|
||||||
|
- **Independent tests**: Tests should not depend on each other
|
||||||
|
- **Clean setup/teardown**: Reset state between tests
|
||||||
|
- **Pi compatibility**: Ensure tests work in Pi environment
|
||||||
38
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Create a report to help us improve
|
||||||
|
title: ''
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Describe the bug**
|
||||||
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
|
**To Reproduce**
|
||||||
|
Steps to reproduce the behavior:
|
||||||
|
1. Go to '...'
|
||||||
|
2. Click on '....'
|
||||||
|
3. Scroll down to '....'
|
||||||
|
4. See error
|
||||||
|
|
||||||
|
**Expected behavior**
|
||||||
|
A clear and concise description of what you expected to happen.
|
||||||
|
|
||||||
|
**Screenshots**
|
||||||
|
If applicable, add screenshots to help explain your problem.
|
||||||
|
|
||||||
|
**Desktop (please complete the following information):**
|
||||||
|
- OS: [e.g. iOS]
|
||||||
|
- Browser [e.g. chrome, safari]
|
||||||
|
- Version [e.g. 22]
|
||||||
|
|
||||||
|
**Smartphone (please complete the following information):**
|
||||||
|
- Device: [e.g. iPhone6]
|
||||||
|
- OS: [e.g. iOS8.1]
|
||||||
|
- Browser [e.g. stock browser, safari]
|
||||||
|
- Version [e.g. 22]
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context about the problem here.
|
||||||
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
name: Feature request
|
||||||
|
about: Suggest an idea for this project
|
||||||
|
title: ''
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Is your feature request related to a problem? Please describe.**
|
||||||
|
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||||
|
|
||||||
|
**Describe the solution you'd like**
|
||||||
|
A clear and concise description of what you want to happen.
|
||||||
|
|
||||||
|
**Describe alternatives you've considered**
|
||||||
|
A clear and concise description of any alternative solutions or features you've considered.
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context or screenshots about the feature request here.
|
||||||
4
.gitignore
vendored
@@ -5,6 +5,8 @@ __pycache__/
|
|||||||
|
|
||||||
# Secrets
|
# Secrets
|
||||||
config/config_secrets.json
|
config/config_secrets.json
|
||||||
|
config/config.json
|
||||||
|
config/config.json.backup
|
||||||
credentials.json
|
credentials.json
|
||||||
token.pickle
|
token.pickle
|
||||||
|
|
||||||
@@ -13,6 +15,7 @@ token.pickle
|
|||||||
.venv
|
.venv
|
||||||
env/
|
env/
|
||||||
venv/
|
venv/
|
||||||
|
venv*/
|
||||||
ENV/
|
ENV/
|
||||||
|
|
||||||
# IDE
|
# IDE
|
||||||
@@ -20,6 +23,7 @@ ENV/
|
|||||||
.idea/
|
.idea/
|
||||||
*.swp
|
*.swp
|
||||||
*.swo
|
*.swo
|
||||||
|
emulator_config.json
|
||||||
|
|
||||||
# Cache directory
|
# Cache directory
|
||||||
cache/
|
cache/
|
||||||
148
AP_TOP_25_IMPLEMENTATION_SUMMARY.md
Normal file
@@ -0,0 +1,148 @@
|
|||||||
|
# AP Top 25 Dynamic Teams Implementation Summary
|
||||||
|
|
||||||
|
## 🎯 Feature Overview
|
||||||
|
|
||||||
|
Successfully implemented dynamic team resolution for AP Top 25 rankings in the LEDMatrix project. Users can now add `"AP_TOP_25"` to their `favorite_teams` list and it will automatically resolve to the current AP Top 25 teams, updating weekly as rankings change.
|
||||||
|
|
||||||
|
## 🚀 What Was Implemented
|
||||||
|
|
||||||
|
### 1. Dynamic Team Resolver (`src/dynamic_team_resolver.py`)
|
||||||
|
- **Core Functionality**: Resolves dynamic team names like `"AP_TOP_25"` into actual team abbreviations
|
||||||
|
- **API Integration**: Fetches current AP Top 25 rankings from ESPN API
|
||||||
|
- **Caching**: 1-hour cache to reduce API calls and improve performance
|
||||||
|
- **Error Handling**: Graceful fallback when rankings unavailable
|
||||||
|
- **Multiple Patterns**: Supports `AP_TOP_25`, `AP_TOP_10`, `AP_TOP_5`
|
||||||
|
|
||||||
|
### 2. Sports Core Integration (`src/base_classes/sports.py`)
|
||||||
|
- **Automatic Resolution**: Favorite teams are automatically resolved at initialization
|
||||||
|
- **Seamless Integration**: Works with existing favorite teams system
|
||||||
|
- **Logging**: Clear logging of dynamic team resolution
|
||||||
|
- **Backward Compatibility**: Regular team names work exactly as before
|
||||||
|
|
||||||
|
### 3. Configuration Updates (`config/config.template.json`)
|
||||||
|
- **Example Usage**: Added `"AP_TOP_25"` to NCAA FB configuration example
|
||||||
|
- **Documentation**: Clear examples of how to use dynamic teams
|
||||||
|
|
||||||
|
### 4. Comprehensive Testing
|
||||||
|
- **Unit Tests**: `test/test_dynamic_team_resolver.py` - Core functionality
|
||||||
|
- **Integration Tests**: `test/test_dynamic_teams_simple.py` - Configuration integration
|
||||||
|
- **Edge Cases**: Unknown dynamic teams, empty lists, mixed teams
|
||||||
|
- **Performance**: Caching verification and performance testing
|
||||||
|
|
||||||
|
### 5. Documentation (`LEDMatrix.wiki/AP_TOP_25_DYNAMIC_TEAMS.md`)
|
||||||
|
- **Complete Guide**: How to use the feature
|
||||||
|
- **Configuration Examples**: Multiple usage scenarios
|
||||||
|
- **Technical Details**: API integration, caching, performance
|
||||||
|
- **Troubleshooting**: Common issues and solutions
|
||||||
|
- **Best Practices**: Recommendations for optimal usage
|
||||||
|
|
||||||
|
## 🔧 Technical Implementation
|
||||||
|
|
||||||
|
### Dynamic Team Resolution Process
|
||||||
|
1. **Detection**: Check if team name is in `DYNAMIC_PATTERNS`
|
||||||
|
2. **API Fetch**: Retrieve current rankings from ESPN API
|
||||||
|
3. **Resolution**: Convert dynamic name to actual team abbreviations
|
||||||
|
4. **Caching**: Store results for 1 hour to reduce API calls
|
||||||
|
5. **Integration**: Seamlessly work with existing favorite teams logic
|
||||||
|
|
||||||
|
### Supported Dynamic Teams
|
||||||
|
| Dynamic Team | Description | Teams Returned |
|
||||||
|
|-------------|-------------|----------------|
|
||||||
|
| `"AP_TOP_25"` | Current AP Top 25 | All 25 ranked teams |
|
||||||
|
| `"AP_TOP_10"` | Current AP Top 10 | Top 10 ranked teams |
|
||||||
|
| `"AP_TOP_5"` | Current AP Top 5 | Top 5 ranked teams |
|
||||||
|
|
||||||
|
### Configuration Examples
|
||||||
|
|
||||||
|
#### Basic AP Top 25 Usage
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ncaa_fb_scoreboard": {
|
||||||
|
"enabled": true,
|
||||||
|
"show_favorite_teams_only": true,
|
||||||
|
"favorite_teams": ["AP_TOP_25"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Mixed Regular and Dynamic Teams
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ncaa_fb_scoreboard": {
|
||||||
|
"enabled": true,
|
||||||
|
"show_favorite_teams_only": true,
|
||||||
|
"favorite_teams": [
|
||||||
|
"UGA",
|
||||||
|
"AUB",
|
||||||
|
"AP_TOP_25"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## ✅ Testing Results
|
||||||
|
|
||||||
|
### All Tests Passing
|
||||||
|
- **Core Functionality**: ✅ Dynamic team resolution works correctly
|
||||||
|
- **API Integration**: ✅ Successfully fetches AP Top 25 from ESPN
|
||||||
|
- **Caching**: ✅ 1-hour cache reduces API calls significantly
|
||||||
|
- **Edge Cases**: ✅ Unknown dynamic teams, empty lists handled properly
|
||||||
|
- **Performance**: ✅ Second call uses cache (0.000s vs 0.062s)
|
||||||
|
- **Integration**: ✅ Works seamlessly with existing sports managers
|
||||||
|
|
||||||
|
### Test Coverage
|
||||||
|
- **Unit Tests**: 6 test categories, all passing
|
||||||
|
- **Integration Tests**: Configuration integration verified
|
||||||
|
- **Edge Cases**: 4 edge case scenarios tested
|
||||||
|
- **Performance**: Caching and API call optimization verified
|
||||||
|
|
||||||
|
## 🎉 Benefits for Users
|
||||||
|
|
||||||
|
### Automatic Updates
|
||||||
|
- **Weekly Updates**: Rankings automatically update when ESPN releases new rankings
|
||||||
|
- **No Manual Work**: Users don't need to manually update team lists
|
||||||
|
- **Always Current**: Always shows games for the current top-ranked teams
|
||||||
|
|
||||||
|
### Flexible Options
|
||||||
|
- **Multiple Ranges**: Choose from AP_TOP_5, AP_TOP_10, or AP_TOP_25
|
||||||
|
- **Mixed Usage**: Combine with regular favorite teams
|
||||||
|
- **Easy Configuration**: Simple addition to existing config
|
||||||
|
|
||||||
|
### Performance Optimized
|
||||||
|
- **Efficient Caching**: 1-hour cache reduces API calls
|
||||||
|
- **Background Updates**: Rankings fetched in background
|
||||||
|
- **Minimal Overhead**: Only fetches when dynamic teams are used
|
||||||
|
|
||||||
|
## 🔮 Future Enhancements
|
||||||
|
|
||||||
|
The system is designed to be extensible for future dynamic team types:
|
||||||
|
|
||||||
|
- `"PLAYOFF_TEAMS"`: Teams in playoff contention
|
||||||
|
- `"CONFERENCE_LEADERS"`: Conference leaders
|
||||||
|
- `"HEISMAN_CANDIDATES"`: Teams with Heisman candidates
|
||||||
|
- `"RIVALRY_GAMES"`: Traditional rivalry matchups
|
||||||
|
|
||||||
|
## 📋 Usage Instructions
|
||||||
|
|
||||||
|
### For Users
|
||||||
|
1. **Add to Config**: Add `"AP_TOP_25"` to your `favorite_teams` list
|
||||||
|
2. **Enable Filtering**: Set `"show_favorite_teams_only": true`
|
||||||
|
3. **Enjoy**: System automatically shows games for current top 25 teams
|
||||||
|
|
||||||
|
### For Developers
|
||||||
|
1. **Import**: `from src.dynamic_team_resolver import DynamicTeamResolver`
|
||||||
|
2. **Resolve**: `resolver.resolve_teams(["AP_TOP_25"], 'ncaa_fb')`
|
||||||
|
3. **Integrate**: Works automatically with existing SportsCore classes
|
||||||
|
|
||||||
|
## 🎯 Success Metrics
|
||||||
|
|
||||||
|
- **✅ Feature Complete**: All planned functionality implemented
|
||||||
|
- **✅ Fully Tested**: Comprehensive test suite with 100% pass rate
|
||||||
|
- **✅ Well Documented**: Complete documentation and examples
|
||||||
|
- **✅ Performance Optimized**: Efficient caching and API usage
|
||||||
|
- **✅ User Friendly**: Simple configuration, automatic updates
|
||||||
|
- **✅ Backward Compatible**: Existing configurations continue to work
|
||||||
|
|
||||||
|
## 🚀 Ready for Production
|
||||||
|
|
||||||
|
The AP Top 25 Dynamic Teams feature is fully implemented, tested, and ready for production use. Users can now enjoy automatically updating favorite teams that follow the current AP Top 25 rankings without any manual intervention.
|
||||||
208
BACKGROUND_SERVICE_README.md
Normal file
@@ -0,0 +1,208 @@
|
|||||||
|
# Background Data Service for LEDMatrix
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
The Background Data Service is a new feature that implements background threading for season data fetching to prevent blocking the main display loop. This significantly improves responsiveness and user experience during data fetching operations.
|
||||||
|
|
||||||
|
## Key Benefits
|
||||||
|
|
||||||
|
- **Non-blocking**: Season data fetching no longer blocks the main display loop
|
||||||
|
- **Immediate Response**: Returns cached or partial data immediately while fetching complete data in background
|
||||||
|
- **Configurable**: Can be enabled/disabled per sport with customizable settings
|
||||||
|
- **Thread-safe**: Uses proper synchronization for concurrent access
|
||||||
|
- **Retry Logic**: Automatic retry with exponential backoff for failed requests
|
||||||
|
- **Progress Tracking**: Comprehensive logging and statistics
|
||||||
|
|
||||||
|
## Architecture
|
||||||
|
|
||||||
|
### Core Components
|
||||||
|
|
||||||
|
1. **BackgroundDataService**: Main service class managing background threads
|
||||||
|
2. **FetchRequest**: Represents individual fetch operations
|
||||||
|
3. **FetchResult**: Contains results of fetch operations
|
||||||
|
4. **Sport Managers**: Updated to use background service
|
||||||
|
|
||||||
|
### How It Works
|
||||||
|
|
||||||
|
1. **Cache Check**: First checks for cached data and returns immediately if available
|
||||||
|
2. **Background Fetch**: If no cache, starts background thread to fetch complete season data
|
||||||
|
3. **Partial Data**: Returns immediate partial data (current/recent games) for quick display
|
||||||
|
4. **Completion**: Background fetch completes and caches full dataset
|
||||||
|
5. **Future Requests**: Subsequent requests use cached data for instant response
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
### NFL Configuration Example
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"nfl_scoreboard": {
|
||||||
|
"enabled": true,
|
||||||
|
"background_service": {
|
||||||
|
"enabled": true,
|
||||||
|
"max_workers": 3,
|
||||||
|
"request_timeout": 30,
|
||||||
|
"max_retries": 3,
|
||||||
|
"priority": 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Configuration Options
|
||||||
|
|
||||||
|
- **enabled**: Enable/disable background service (default: true)
|
||||||
|
- **max_workers**: Maximum number of background threads (default: 3)
|
||||||
|
- **request_timeout**: HTTP request timeout in seconds (default: 30)
|
||||||
|
- **max_retries**: Maximum retry attempts for failed requests (default: 3)
|
||||||
|
- **priority**: Request priority (higher = more important, default: 2)
|
||||||
|
|
||||||
|
## Implementation Status
|
||||||
|
|
||||||
|
### Phase 1: Background Season Data Fetching ✅ COMPLETED
|
||||||
|
|
||||||
|
- [x] Created BackgroundDataService class
|
||||||
|
- [x] Implemented thread-safe data caching
|
||||||
|
- [x] Added retry logic with exponential backoff
|
||||||
|
- [x] Modified NFL manager to use background service
|
||||||
|
- [x] Added configuration support
|
||||||
|
- [x] Created test script
|
||||||
|
|
||||||
|
### Phase 2: Rollout to Other Sports (Next Steps)
|
||||||
|
|
||||||
|
- [ ] Apply to NCAAFB manager
|
||||||
|
- [ ] Apply to NBA manager
|
||||||
|
- [ ] Apply to NHL manager
|
||||||
|
- [ ] Apply to MLB manager
|
||||||
|
- [ ] Apply to other sport managers
|
||||||
|
|
||||||
|
## Testing
|
||||||
|
|
||||||
|
### Test Script
|
||||||
|
|
||||||
|
Run the test script to verify background service functionality:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python test_background_service.py
|
||||||
|
```
|
||||||
|
|
||||||
|
### Test Scenarios
|
||||||
|
|
||||||
|
1. **Cache Hit**: Verify immediate return of cached data
|
||||||
|
2. **Background Fetch**: Verify non-blocking background data fetching
|
||||||
|
3. **Partial Data**: Verify immediate return of partial data during background fetch
|
||||||
|
4. **Completion**: Verify background fetch completion and caching
|
||||||
|
5. **Subsequent Requests**: Verify cache usage for subsequent requests
|
||||||
|
6. **Service Disabled**: Verify fallback to synchronous fetching
|
||||||
|
|
||||||
|
### Expected Results
|
||||||
|
|
||||||
|
- Initial fetch should return partial data immediately (< 1 second)
|
||||||
|
- Background fetch should complete within 10-30 seconds
|
||||||
|
- Subsequent fetches should use cache (< 0.1 seconds)
|
||||||
|
- No blocking of main display loop
|
||||||
|
|
||||||
|
## Performance Impact
|
||||||
|
|
||||||
|
### Before Background Service
|
||||||
|
- Season data fetch: 10-30 seconds (blocking)
|
||||||
|
- Display loop: Frozen during fetch
|
||||||
|
- User experience: Poor responsiveness
|
||||||
|
|
||||||
|
### After Background Service
|
||||||
|
- Initial response: < 1 second (partial data)
|
||||||
|
- Background fetch: 10-30 seconds (non-blocking)
|
||||||
|
- Display loop: Continues normally
|
||||||
|
- User experience: Excellent responsiveness
|
||||||
|
|
||||||
|
## Monitoring
|
||||||
|
|
||||||
|
### Logs
|
||||||
|
|
||||||
|
The service provides comprehensive logging:
|
||||||
|
|
||||||
|
```
|
||||||
|
[NFL] Background service enabled with 3 workers
|
||||||
|
[NFL] Starting background fetch for 2024 season schedule...
|
||||||
|
[NFL] Using 15 immediate events while background fetch completes
|
||||||
|
[NFL] Background fetch completed for 2024: 256 events
|
||||||
|
```
|
||||||
|
|
||||||
|
### Statistics
|
||||||
|
|
||||||
|
Access service statistics:
|
||||||
|
|
||||||
|
```python
|
||||||
|
stats = background_service.get_statistics()
|
||||||
|
print(f"Total requests: {stats['total_requests']}")
|
||||||
|
print(f"Cache hits: {stats['cached_hits']}")
|
||||||
|
print(f"Average fetch time: {stats['average_fetch_time']:.2f}s")
|
||||||
|
```
|
||||||
|
|
||||||
|
## Error Handling
|
||||||
|
|
||||||
|
### Automatic Retry
|
||||||
|
- Failed requests are automatically retried with exponential backoff
|
||||||
|
- Maximum retry attempts are configurable
|
||||||
|
- Failed requests are logged with error details
|
||||||
|
|
||||||
|
### Fallback Behavior
|
||||||
|
- If background service is disabled, falls back to synchronous fetching
|
||||||
|
- If background fetch fails, returns partial data if available
|
||||||
|
- Graceful degradation ensures system continues to function
|
||||||
|
|
||||||
|
## Future Enhancements
|
||||||
|
|
||||||
|
### Phase 2 Features
|
||||||
|
- Apply to all sport managers
|
||||||
|
- Priority-based request queuing
|
||||||
|
- Dynamic worker scaling
|
||||||
|
- Request batching for efficiency
|
||||||
|
|
||||||
|
### Phase 3 Features
|
||||||
|
- Real-time data streaming
|
||||||
|
- WebSocket support for live updates
|
||||||
|
- Advanced caching strategies
|
||||||
|
- Performance analytics dashboard
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
### Common Issues
|
||||||
|
|
||||||
|
1. **Background service not starting**
|
||||||
|
- Check configuration: `background_service.enabled = true`
|
||||||
|
- Verify cache manager is properly initialized
|
||||||
|
- Check logs for initialization errors
|
||||||
|
|
||||||
|
2. **Slow background fetches**
|
||||||
|
- Increase `request_timeout` in configuration
|
||||||
|
- Check network connectivity
|
||||||
|
- Monitor API rate limits
|
||||||
|
|
||||||
|
3. **Memory usage**
|
||||||
|
- Background service automatically cleans up old requests
|
||||||
|
- Adjust `max_workers` if needed
|
||||||
|
- Monitor cache size
|
||||||
|
|
||||||
|
### Debug Mode
|
||||||
|
|
||||||
|
Enable debug logging for detailed information:
|
||||||
|
|
||||||
|
```python
|
||||||
|
logging.getLogger('src.background_data_service').setLevel(logging.DEBUG)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
When adding background service support to new sport managers:
|
||||||
|
|
||||||
|
1. Import the background service
|
||||||
|
2. Initialize in `__init__` method
|
||||||
|
3. Update data fetching method to use background service
|
||||||
|
4. Add configuration options
|
||||||
|
5. Test thoroughly
|
||||||
|
6. Update documentation
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
This feature is part of the LEDMatrix project and follows the same license terms.
|
||||||
@@ -1,326 +0,0 @@
|
|||||||
# LED Matrix Installation Guide
|
|
||||||
|
|
||||||
## Quick Start (Recommended for First-Time Installation)
|
|
||||||
|
|
||||||
# System Setup & Installation
|
|
||||||
|
|
||||||
1. Open PowerShell and ssh into your Raspberry Pi with ledpi@ledpi (or Username@Hostname)
|
|
||||||
```bash
|
|
||||||
ssh ledpi@ledpi
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Update repositories, upgrade raspberry pi OS, install git
|
|
||||||
```bash
|
|
||||||
sudo apt update && sudo apt upgrade -y
|
|
||||||
sudo apt install -y git python3-pip cython3 build-essential python3-dev python3-pillow scons
|
|
||||||
```
|
|
||||||
|
|
||||||
3. Clone this repository:
|
|
||||||
```bash
|
|
||||||
git clone https://github.com/ChuckBuilds/LEDMatrix.git
|
|
||||||
cd LEDMatrix
|
|
||||||
```
|
|
||||||
|
|
||||||
4. Install dependencies:
|
|
||||||
```bash
|
|
||||||
sudo pip3 install --break-system-packages -r requirements.txt
|
|
||||||
```
|
|
||||||
--break-system-packages allows us to install without a virtual environment
|
|
||||||
|
|
||||||
|
|
||||||
5. Install rpi-rgb-led-matrix dependencies:
|
|
||||||
```bash
|
|
||||||
cd rpi-rgb-led-matrix-master
|
|
||||||
```
|
|
||||||
```bash
|
|
||||||
sudo make build-python PYTHON=$(which python3)
|
|
||||||
```
|
|
||||||
```bash
|
|
||||||
cd bindings/python
|
|
||||||
sudo python3 setup.py install
|
|
||||||
```
|
|
||||||
Test it with:
|
|
||||||
```bash
|
|
||||||
python3 -c 'from rgbmatrix import RGBMatrix, RGBMatrixOptions; print("Success!")'
|
|
||||||
```
|
|
||||||
|
|
||||||
## Important: Sound Module Configuration
|
|
||||||
|
|
||||||
1. Remove unnecessary services that might interfere with the LED matrix:
|
|
||||||
```bash
|
|
||||||
sudo apt-get remove bluez bluez-firmware pi-bluetooth triggerhappy pigpio
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Blacklist the sound module:
|
|
||||||
```bash
|
|
||||||
cat <<EOF | sudo tee /etc/modprobe.d/blacklist-rgb-matrix.conf
|
|
||||||
blacklist snd_bcm2835
|
|
||||||
EOF
|
|
||||||
```
|
|
||||||
|
|
||||||
then execute
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo update-initramfs -u
|
|
||||||
```
|
|
||||||
|
|
||||||
3. Reboot:
|
|
||||||
```bash
|
|
||||||
sudo reboot
|
|
||||||
```
|
|
||||||
|
|
||||||
## Performance Optimization
|
|
||||||
|
|
||||||
To reduce flickering and improve display quality:
|
|
||||||
|
|
||||||
1. Edit `/boot/firmware/cmdline.txt`:
|
|
||||||
```bash
|
|
||||||
sudo nano /boot/firmware/cmdline.txt
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Add `isolcpus=3` at the end of the line
|
|
||||||
|
|
||||||
3. Ctrl + X to exit, Y to save, Enter to Confirm
|
|
||||||
|
|
||||||
4. Edit /boot/firmware/config.txt with
|
|
||||||
```bash
|
|
||||||
sudo nano /boot/firmware/config.txt
|
|
||||||
```
|
|
||||||
|
|
||||||
6. Edit the `dtparam=audio=on` section to `dtparam=audio=off`
|
|
||||||
|
|
||||||
7. Ctrl + X to exit, Y to save, Enter to Confirm
|
|
||||||
|
|
||||||
8. Save and reboot:
|
|
||||||
```bash
|
|
||||||
sudo reboot
|
|
||||||
```
|
|
||||||
|
|
||||||
9. Run the first_time_install.sh with
|
|
||||||
```
|
|
||||||
sudo ./first_time_install.sh
|
|
||||||
```
|
|
||||||
to ensure all the permissions are correct.
|
|
||||||
|
|
||||||
10. Then run
|
|
||||||
|
|
||||||
```
|
|
||||||
sudo python start_web_conditionally.py
|
|
||||||
```
|
|
||||||
to start the web ui and download the r
|
|
||||||
-----------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
## Configuration
|
|
||||||
|
|
||||||
1.Edit `config/config.json` with your preferences via `sudo nano config/config.json`
|
|
||||||
|
|
||||||
###API Keys
|
|
||||||
|
|
||||||
For sensitive settings like API keys:
|
|
||||||
Copy the template: `cp config/config_secrets.template.json config/config_secrets.json`
|
|
||||||
Edit `config/config_secrets.json` with your API keys via `sudo nano config/config_secrets.json`
|
|
||||||
Ctrl + X to exit, Y to overwrite, Enter to Confirm
|
|
||||||
|
|
||||||
Everything is configured via `config/config.json` and `config/config_secrets.json`.
|
|
||||||
|
|
||||||
|
|
||||||
For a complete first-time installation, run:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
chmod +x first_time_install.sh
|
|
||||||
```
|
|
||||||
then
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo ./first_time_install.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
This single script handles everything you need for a new installation.
|
|
||||||
|
|
||||||
## Individual Scripts Explained
|
|
||||||
|
|
||||||
### **First-Time Installation Scripts**
|
|
||||||
|
|
||||||
#### `first_time_install.sh` ⭐ **RECOMMENDED**
|
|
||||||
- **When to use**: New installations only
|
|
||||||
- **What it does**: Complete setup including all steps below
|
|
||||||
- **Usage**: `sudo ./first_time_install.sh`
|
|
||||||
|
|
||||||
### **Service Installation Scripts**
|
|
||||||
|
|
||||||
#### `install_service.sh`
|
|
||||||
- **When to use**: Install main LED Matrix display service
|
|
||||||
- **What it does**:
|
|
||||||
- Creates systemd service for main display
|
|
||||||
- Creates systemd service for web interface
|
|
||||||
- Enables services to start on boot
|
|
||||||
- **Usage**: `sudo ./install_service.sh`
|
|
||||||
|
|
||||||
#### `install_web_service.sh`
|
|
||||||
- **When to use**: Install only the web interface service (legacy)
|
|
||||||
- **What it does**: Installs the web interface systemd service
|
|
||||||
- **Usage**: `sudo ./install_web_service.sh`
|
|
||||||
- **Note**: `install_service.sh` now handles this automatically
|
|
||||||
|
|
||||||
### **Permission Fix Scripts**
|
|
||||||
|
|
||||||
#### `fix_cache_permissions.sh`
|
|
||||||
- **When to use**: When you see cache permission errors
|
|
||||||
- **What it does**:
|
|
||||||
- Creates cache directories (`/var/cache/ledmatrix`)
|
|
||||||
- Sets proper permissions for cache access
|
|
||||||
- Creates placeholder logo directories
|
|
||||||
- **Usage**: `sudo ./fix_cache_permissions.sh`
|
|
||||||
|
|
||||||
#### `fix_web_permissions.sh`
|
|
||||||
- **When to use**: When web interface can't access logs or system commands
|
|
||||||
- **What it does**:
|
|
||||||
- Adds user to `systemd-journal` group (for log access)
|
|
||||||
- Adds user to `adm` group (for system access)
|
|
||||||
- Sets proper file ownership
|
|
||||||
- **Usage**: `./fix_web_permissions.sh` (run as regular user)
|
|
||||||
|
|
||||||
#### `configure_web_sudo.sh`
|
|
||||||
- **When to use**: When web interface buttons don't work (sudo password errors)
|
|
||||||
- **What it does**:
|
|
||||||
- Configures passwordless sudo access for web interface
|
|
||||||
- Allows web interface to start/stop services without password
|
|
||||||
- **Usage**: `./configure_web_sudo.sh` (run as regular user)
|
|
||||||
|
|
||||||
### **Dependency Installation Scripts**
|
|
||||||
|
|
||||||
#### `install_dependencies_apt.py`
|
|
||||||
- **When to use**: When you want to install packages via apt first, then pip
|
|
||||||
- **What it does**:
|
|
||||||
- Tries to install packages via apt (system packages)
|
|
||||||
- Falls back to pip with `--break-system-packages`
|
|
||||||
- Handles externally managed Python environments
|
|
||||||
- **Usage**: `sudo python3 install_dependencies_apt.py`
|
|
||||||
|
|
||||||
#### `start_web_v2.py`
|
|
||||||
- **When to use**: Manual web interface startup
|
|
||||||
- **What it does**:
|
|
||||||
- Installs dependencies
|
|
||||||
- Starts web interface directly
|
|
||||||
- Includes comprehensive logging
|
|
||||||
- **Usage**: `python3 start_web_v2.py`
|
|
||||||
|
|
||||||
#### `run_web_v2.sh`
|
|
||||||
- **When to use**: Manual web interface startup (shell script version)
|
|
||||||
- **What it does**: Same as `start_web_v2.py` but as a shell script
|
|
||||||
- **Usage**: `./run_web_v2.sh`
|
|
||||||
|
|
||||||
### **Utility Scripts**
|
|
||||||
|
|
||||||
#### `cleanup_venv.sh`
|
|
||||||
- **When to use**: Remove virtual environment if you don't want to use it
|
|
||||||
- **What it does**: Removes `venv_web_v2` directory
|
|
||||||
- **Usage**: `./cleanup_venv.sh`
|
|
||||||
|
|
||||||
#### `start_web_conditionally.py`
|
|
||||||
- **When to use**: Called by systemd service (don't run manually)
|
|
||||||
- **What it does**:
|
|
||||||
- Checks config for `web_display_autostart` setting
|
|
||||||
- Starts web interface only if enabled
|
|
||||||
- Used by the systemd service
|
|
||||||
|
|
||||||
## Installation Scenarios
|
|
||||||
|
|
||||||
### **Scenario 1: Brand New Installation**
|
|
||||||
```bash
|
|
||||||
# One command does everything
|
|
||||||
sudo ./first_time_install.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
### **Scenario 2: Adding Web Interface to Existing Installation**
|
|
||||||
```bash
|
|
||||||
# Install web interface dependencies
|
|
||||||
sudo python3 install_dependencies_apt.py
|
|
||||||
|
|
||||||
# Fix permissions
|
|
||||||
./fix_web_permissions.sh
|
|
||||||
|
|
||||||
# Configure sudo access
|
|
||||||
./configure_web_sudo.sh
|
|
||||||
|
|
||||||
# Install services
|
|
||||||
sudo ./install_service.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
### **Scenario 3: Fixing Permission Issues**
|
|
||||||
```bash
|
|
||||||
# Fix cache permissions
|
|
||||||
sudo ./fix_cache_permissions.sh
|
|
||||||
|
|
||||||
# Fix web interface permissions
|
|
||||||
./fix_web_permissions.sh
|
|
||||||
|
|
||||||
# Configure sudo access
|
|
||||||
./configure_web_sudo.sh
|
|
||||||
|
|
||||||
# Log out and back in for group changes to take effect
|
|
||||||
```
|
|
||||||
|
|
||||||
### **Scenario 4: Manual Web Interface Startup**
|
|
||||||
```bash
|
|
||||||
# Start web interface manually (for testing)
|
|
||||||
python3 start_web_v2.py
|
|
||||||
```
|
|
||||||
|
|
||||||
## Post-Installation Steps
|
|
||||||
|
|
||||||
### **1. Log Out and Log Back In**
|
|
||||||
After running permission scripts, you need to log out and back in for group changes to take effect:
|
|
||||||
```bash
|
|
||||||
# Or use this command to apply group changes immediately
|
|
||||||
newgrp systemd-journal
|
|
||||||
```
|
|
||||||
|
|
||||||
### **2. Configure the Web Interface**
|
|
||||||
Edit `config/config.json` and set:
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"web_display_autostart": true
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### **3. Access the Web Interface**
|
|
||||||
Open your browser and go to:
|
|
||||||
```
|
|
||||||
http://your-pi-ip:5001
|
|
||||||
```
|
|
||||||
|
|
||||||
### **4. Test Everything**
|
|
||||||
- Check if services are running: `sudo systemctl status ledmatrix.service`
|
|
||||||
- Check web interface: `sudo systemctl status ledmatrix-web.service`
|
|
||||||
- View logs: `journalctl -u ledmatrix.service -f`
|
|
||||||
|
|
||||||
## Troubleshooting
|
|
||||||
|
|
||||||
### **Web Interface Not Accessible**
|
|
||||||
1. Check if service is running: `sudo systemctl status ledmatrix-web.service`
|
|
||||||
2. Check logs: `journalctl -u ledmatrix-web.service -f`
|
|
||||||
3. Ensure `web_display_autostart` is `true` in config
|
|
||||||
|
|
||||||
### **Permission Errors**
|
|
||||||
1. Run: `./fix_web_permissions.sh`
|
|
||||||
2. Run: `./configure_web_sudo.sh`
|
|
||||||
3. Log out and back in
|
|
||||||
|
|
||||||
### **Cache Permission Errors**
|
|
||||||
1. Run: `sudo ./fix_cache_permissions.sh`
|
|
||||||
|
|
||||||
### **Sudo Password Prompts**
|
|
||||||
1. Run: `./configure_web_sudo.sh`
|
|
||||||
2. Log out and back in
|
|
||||||
|
|
||||||
### **Dependency Installation Errors**
|
|
||||||
1. Run: `sudo python3 install_dependencies_apt.py`
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
For **first-time installations**: Use `first_time_install.sh`
|
|
||||||
|
|
||||||
For **existing installations with issues**: Use the individual permission and configuration scripts as needed.
|
|
||||||
|
|
||||||
The `first_time_install.sh` script is designed to handle everything automatically, so you typically only need to run individual scripts if you're troubleshooting specific issues.
|
|
||||||
651
README.md
@@ -25,48 +25,59 @@
|
|||||||
- Randomwire @ https://www.thingiverse.com/thing:5169867 for their 4mm Pixel Pitch LED Matrix Stand
|
- Randomwire @ https://www.thingiverse.com/thing:5169867 for their 4mm Pixel Pitch LED Matrix Stand
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-----------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
## Core Features
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Core Features</summary>
|
||||||
## Core Features
|
## Core Features
|
||||||
Modular, rotating Displays that can be individually enabled or disabled per the user's needs with some configuration around display durations, teams, stocks, weather, timezones, and more. Displays include:
|
Modular, rotating Displays that can be individually enabled or disabled per the user's needs with some configuration around display durations, teams, stocks, weather, timezones, and more. Displays include:
|
||||||
|
|
||||||
### Time and Weather
|
### Time and Weather
|
||||||
- Real-time clock display
|
- Real-time clock display (2x 64x32 Displays 4mm Pixel Pitch)
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
- Current Weather, Daily Weather, and Hourly Weather Forecasts
|
- Current Weather, Daily Weather, and Hourly Weather Forecasts (2x 64x32 Displays 4mm Pixel Pitch)
|
||||||

|

|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
- Google Calendar event display
|
- Google Calendar event display (2x 64x32 Displays 4mm Pixel Pitch)
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Sports Information
|
### Sports Information
|
||||||
The system supports live, recent, and upcoming game information for multiple sports leagues:
|
The system supports live, recent, and upcoming game information for multiple sports leagues:
|
||||||
- NHL (Hockey)
|
- NHL (Hockey) (2x 64x32 Displays 4mm Pixel Pitch)
|
||||||

|

|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
- NBA (Basketball)
|
- NBA (Basketball)
|
||||||
- MLB (Baseball)
|
- MLB (Baseball) (2x 64x32 Displays 4mm Pixel Pitch)
|
||||||

|

|
||||||
|
|
||||||
- NFL (Football)
|
- NFL (Football) (2x 96x48 Displays 2.5mm Pixel Pitch)
|
||||||
- NCAA Football
|
<img width="2109" height="541" alt="image" src="https://github.com/user-attachments/assets/d10212c9-0d45-4f87-b61d-0a33afb9f160" />
|
||||||
|
- NCAA Football (2x 96x48 Displays 2.5mm Pixel Pitch)
|
||||||
|
<img width="2417" height="610" alt="image" src="https://github.com/user-attachments/assets/9be92869-ee29-4809-9337-69977f228e23" />
|
||||||
|
|
||||||
- NCAA Men's Basketball
|
- NCAA Men's Basketball
|
||||||
- NCAA Men's Baseball
|
- NCAA Men's Baseball
|
||||||
- Soccer
|
- Soccer (Premier League, La Liga, Bundesliga, Serie A, Ligue 1, Liga Portugal, Champions League, Europa League, MLS)
|
||||||
- (Note, some of these sports seasons were not active during development and might need fine tuning when games are active)
|
- (Note, some of these sports seasons were not active during development and might need fine tuning when games are active)
|
||||||
|
|
||||||
|
|
||||||
### Financial Information
|
### Financial Information
|
||||||
- Near real-time stock & crypto price updates
|
- Near real-time stock & crypto price updates
|
||||||
- Stock news headlines
|
- Stock news headlines
|
||||||
- Customizable stock & crypto watchlists
|
- Customizable stock & crypto watchlists (2x 64x32 Displays 4mm Pixel Pitch)
|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
@@ -77,45 +88,50 @@ The system supports live, recent, and upcoming game information for multiple spo
|
|||||||
- Spotify integration
|
- Spotify integration
|
||||||
- YouTube Music integration
|
- YouTube Music integration
|
||||||
- Album art display
|
- Album art display
|
||||||
- Now playing information with scrolling text
|
- Now playing information with scrolling text (2x 64x32 Displays 4mm Pixel Pitch)
|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Custom Display Features
|
### Custom Display Features
|
||||||
- Custom Text display
|
- Custom Text display (2x 64x32 Displays 4mm Pixel Pitch)
|
||||||

|

|
||||||
|
|
||||||
- Youtube Subscriber Count Display
|
- Youtube Subscriber Count Display (2x 64x32 Displays 4mm Pixel Pitch)
|
||||||

|

|
||||||
|
|
||||||
- Font testing Display (not in rotation)
|
- Font testing Display (not in rotation)
|
||||||
|
</details>
|
||||||
|
|
||||||
## System Architecture
|
-----------------------------------------------------------------------------------
|
||||||
|
|
||||||
The system is built with a modular architecture that allows for easy extension and maintenance:
|
|
||||||
- `DisplayController`: Main orchestrator managing all display modes
|
|
||||||
- Individual managers for each feature (sports, weather, music, etc.)
|
|
||||||
- Separate authentication handlers for different services
|
|
||||||
- Configurable display modes and rotation patterns from one file - config.json
|
|
||||||
|
|
||||||
## Configuration
|
|
||||||
|
|
||||||
The system can be configured through a JSON configuration file that allows users to:
|
|
||||||
- Enable/disable specific features
|
|
||||||
- Set display durations
|
|
||||||
- Configure API keys and endpoints
|
|
||||||
- Customize display modes and rotation patterns
|
|
||||||
- Set preferred music sources
|
|
||||||
- Configure sports team preferences
|
|
||||||
|
|
||||||
|
## Hardware
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Hardware Requirements</summary>
|
||||||
## Hardware Requirements
|
## Hardware Requirements
|
||||||
- Raspberry Pi 3b or 4 (NOT RPI5!) : Amazon Affiliate Link: Raspberry Pi 4 4GB (https://amzn.to/4dJixuX)
|
|
||||||
- Adafruit RGB Matrix Bonnet/HAT : https://www.adafruit.com/product/3211
|
### Raspberry Pi
|
||||||
- 2x LED Matrix panels (64x32) (Designed for 128x32 but has a lot of dynamic scaling elements that could work on a variety of displays, pixel pitch is user preference) : https://www.adafruit.com/product/2278
|
- **Raspberry Pi 3B or 4 (NOT RPi 5!)**
|
||||||
- 5V 4A DC Power Supply for Adafruit RGB HAT : https://www.adafruit.com/product/1466
|
[Amazon Affiliate Link – Raspberry Pi 4 4GB](https://amzn.to/4dJixuX)
|
||||||
|
|
||||||
|
### RGB Matrix Bonnet / HAT
|
||||||
|
- [Adafruit RGB Matrix Bonnet/HAT](https://www.adafruit.com/product/3211) – supports one “chain” of horizontally connected displays
|
||||||
|
- [Adafruit Triple LED Matrix Bonnet](https://www.adafruit.com/product/6358) – supports up to 3 vertical “chains” of horizontally connected displays *(use `regular-pi1` as hardware mapping)*
|
||||||
|
- [Electrodragon RGB HAT](https://www.electrodragon.com/product/rgb-matrix-panel-drive-board-raspberry-pi/) – supports up to 3 vertical “chains”
|
||||||
|
- [Seengreat Matrix Adapter Board](https://amzn.to/3KsnT3j) – single-chain LED Matrix *(use `regular` as hardware mapping)*
|
||||||
|
|
||||||
|
### LED Matrix Panels
|
||||||
|
(2x in a chain recommended)
|
||||||
|
- [Adafruit 64×32](https://www.adafruit.com/product/2278) – designed for 128×32 but works with dynamic scaling on many displays (pixel pitch is user preference)
|
||||||
|
- [Waveshare 64×32](https://amzn.to/3Kw55jK) - Does not require E addressable pad
|
||||||
|
- [Waveshare 92×46](https://amzn.to/4pQdezE) – higher resolution, requires soldering the **E addressable pad** on the [Adafruit RGB Bonnet](https://www.adafruit.com/product/3211) to “8” **OR** toggling the DIP switch on the Adafruit Triple LED Matrix Bonnet *(no soldering required!)*
|
||||||
|
> Amazon Affiliate Link – ChuckBuilds receives a small commission on purchases
|
||||||
|
|
||||||
|
### Power Supply
|
||||||
|
- [5V 4A DC Power Supply](https://www.adafruit.com/product/658) (good for 2 -3 displays, depending on brightness and pixel density, you'll need higher amperage for more)
|
||||||
|
- [5V 10AM DC Power Supply](https://amzn.to/3IKlYqe) (good for 6-8 displays, depending on brightness and pixel density)
|
||||||
|
|
||||||
## Optional but recommended mod for Adafruit RGB Matrix Bonnet
|
## Optional but recommended mod for Adafruit RGB Matrix Bonnet
|
||||||
- By soldering a jumper between pins 4 and 18, you can run a specialized command for polling the matrix display. This provides better brightness, less flicker, and better color.
|
- By soldering a jumper between pins 4 and 18, you can run a specialized command for polling the matrix display. This provides better brightness, less flicker, and better color.
|
||||||
@@ -123,22 +139,69 @@ The system can be configured through a JSON configuration file that allows users
|
|||||||
- More information available: https://github.com/hzeller/rpi-rgb-led-matrix/tree/master?tab=readme-ov-file
|
- More information available: https://github.com/hzeller/rpi-rgb-led-matrix/tree/master?tab=readme-ov-file
|
||||||

|

|
||||||
|
|
||||||
-----------------------------------------------------------------------------------
|
## Possibly required depending on the display you are using.
|
||||||
|
- Some LED Matrix displays require an "E" addressable line to draw the display properly. The [64x32 Adafruit display](https://www.adafruit.com/product/2278) does NOT require the E addressable line, however the [92x46 Waveshare display](https://amzn.to/4pQdezE) DOES require the "E" Addressable line.
|
||||||
|
- Various ways to enable this depending on your Bonnet / HAT.
|
||||||
|
|
||||||
|
Your display will look like it is "sort of" working but still messed up.
|
||||||
|
<img width="841" height="355" alt="image" src="https://github.com/user-attachments/assets/7b8cfa98-270c-4c41-9cdc-146535eec32f" />
|
||||||
|
or
|
||||||
|
<img width="924" height="316" alt="image" src="https://github.com/user-attachments/assets/fda59057-faca-401b-8d55-f0e360cadbdf" />
|
||||||
|
or
|
||||||
|
<img width="1363" height="703" alt="image" src="https://github.com/user-attachments/assets/0e833721-1690-4446-a6a9-7c48eed7a633" />
|
||||||
|
|
||||||
|
How to set addressable E line on various HATs:
|
||||||
|
|
||||||
|
- Adafruit Single Chain HATs
|
||||||
|
<img width="719" height="958" alt="IMG_5228" src="https://github.com/user-attachments/assets/b30e839c-6fc9-4129-a99c-0f4eaf62c89d" />
|
||||||
|
or
|
||||||
|
<img width="349" height="302" alt="image" src="https://github.com/user-attachments/assets/2175fa40-98a8-4da7-bcd3-d6b1714e33d2" />
|
||||||
|
|
||||||
|
- Adafruit Triple Chain HAT
|
||||||
|

|
||||||
|
|
||||||
|
- ElectroDragon RGB LED Matrix Panel Drive Board
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
2 Matrix display with Rpi connected to Adafruit Single Chain HAT.
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
|
||||||
|
<summary>Mount / Stand options</summary>
|
||||||
|
|
||||||
|
|
||||||
## Mount/Stand
|
## Mount/Stand
|
||||||
I 3D printed stands to keep the panels upright and snug. STL Files are included in the Repo but are also available at https://www.thingiverse.com/thing:5169867 Thanks to "Randomwire" for making these for the 4mm Pixel Pitch LED Matrix.
|
I 3D printed stands to keep the panels upright and snug. STL Files are included in the Repo but are also available at https://www.thingiverse.com/thing:5169867 Thanks to "Randomwire" for making these for the 4mm Pixel Pitch LED Matrix.
|
||||||
|
|
||||||
|
Special Thanks for Rmatze for making:
|
||||||
|
- 3mm Pixel Pitch RGB Stand for 32x64 Display : https://www.thingiverse.com/thing:7149818
|
||||||
|
- 4mm Pixel Pitch RGB Stand for 32x64 Display : https://www.thingiverse.com/thing:7165993
|
||||||
|
|
||||||
These are not required and you can probably rig up something basic with stuff you have around the house. I used these screws: https://amzn.to/4mFwNJp (Amazon Affiliate Link)
|
These are not required and you can probably rig up something basic with stuff you have around the house. I used these screws: https://amzn.to/4mFwNJp (Amazon Affiliate Link)
|
||||||
|
|
||||||
-----------------------------------------------------------------------------------
|
</details>
|
||||||
|
|
||||||
2 Matrix display with Rpi connected.
|
|
||||||

|
|
||||||
|
|
||||||
-----------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------
|
||||||
|
## Installation Steps
|
||||||
|
|
||||||
|
|
||||||
|
<details>
|
||||||
|
|
||||||
|
<summary>Preparing the Raspberry Pi</summary>
|
||||||
|
|
||||||
# Preparing the Raspberry Pi
|
# Preparing the Raspberry Pi
|
||||||
1. Create RPI Image on a Micro-SD card (I use 16gb because I have it, size is not too important but I would use 8gb or more) using [Raspberry Pi Imager](https://www.raspberrypi.com/software/)
|
1. Create RPI Image on a Micro-SD card (I use 16gb because I have it, size is not too important but I would use 8gb or more) using [Raspberry Pi Imager](https://www.raspberrypi.com/software/)
|
||||||
2. Choose your Raspberry Pi (3B+ in my case)
|
2. Choose your Raspberry Pi (3B+ in my case)
|
||||||
3. For Operating System (OS), choose "Other", then choose Raspbian OS Lite (64-bit)
|
3. For Operating System (OS), choose "Other", then choose Raspbian OS (Legacy, 64-bit) Lite (This needs to be Debian Bookworm not Debian Trixie! Packages are broken on Trixie as of 10/2/25. I will try to get working as soon as requirements are met!)
|
||||||
|

|
||||||
4. For Storage, choose your micro-sd card
|
4. For Storage, choose your micro-sd card
|
||||||

|

|
||||||
5. Press Next then Edit Settings
|
5. Press Next then Edit Settings
|
||||||
@@ -148,9 +211,13 @@ These are not required and you can probably rig up something basic with stuff yo
|
|||||||
7. Under the Services Tab, make sure that SSH is enabled. I recommend using password authentication for ease of use - it is the password you just chose above.
|
7. Under the Services Tab, make sure that SSH is enabled. I recommend using password authentication for ease of use - it is the password you just chose above.
|
||||||

|

|
||||||
8. Then Click "Save" and Agree to Overwrite the Micro-SD card.
|
8. Then Click "Save" and Agree to Overwrite the Micro-SD card.
|
||||||
|
</details>
|
||||||
|
|
||||||
|
|
||||||
-----------------------------------------------------------------------------------
|
|
||||||
|
<details>
|
||||||
|
|
||||||
|
<summary>System Setup & Installation</summary>
|
||||||
|
|
||||||
# System Setup & Installation
|
# System Setup & Installation
|
||||||
|
|
||||||
@@ -171,6 +238,32 @@ git clone https://github.com/ChuckBuilds/LEDMatrix.git
|
|||||||
cd LEDMatrix
|
cd LEDMatrix
|
||||||
```
|
```
|
||||||
|
|
||||||
|
REMOVE ME BEFORE PR:
|
||||||
|
To use the BETA Plugins branch (things will be broken!) on Rasbian 13 Trixie type:
|
||||||
|
```bash
|
||||||
|
git checkout plugins
|
||||||
|
git pull
|
||||||
|
```
|
||||||
|
otherwise continue to the next step for the stable older version (that only works on Rasbian 12!)
|
||||||
|
|
||||||
|
4. First-time installation (recommended)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
chmod +x first_time_install.sh
|
||||||
|
sudo bash ./first_time_install.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
This single script installs services, dependencies, configures permissions and sudoers, and validates the setup.
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
|
||||||
|
<summary>Outdated Installation Steps left for reference</summary>
|
||||||
|
|
||||||
|
|
||||||
|
-----------------------------------------------------------------------------------
|
||||||
|
----- OLD STEPS (left for manual review, you don't need to run these if you run the First Time Install Script) -----
|
||||||
4. Install dependencies:
|
4. Install dependencies:
|
||||||
```bash
|
```bash
|
||||||
sudo pip3 install --break-system-packages -r requirements.txt
|
sudo pip3 install --break-system-packages -r requirements.txt
|
||||||
@@ -245,38 +338,69 @@ sudo nano /boot/firmware/config.txt
|
|||||||
```bash
|
```bash
|
||||||
sudo reboot
|
sudo reboot
|
||||||
```
|
```
|
||||||
|
## Configuration
|
||||||
|
|
||||||
9. Run the first_time_install.sh with
|
### Initial Setup
|
||||||
|
|
||||||
```bash
|
1. **First-time setup**: (First Time Script should do this for you) Copy the template to create your config:
|
||||||
chmod +x first_time_install.sh
|
```bash
|
||||||
```
|
cp config/config.template.json config/config.json
|
||||||
then
|
```
|
||||||
|
|
||||||
```bash
|
</details>
|
||||||
sudo ./first_time_install.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
to ensure all the permissions are correct.
|
|
||||||
|
|
||||||
-----------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
1.Edit `config/config.json` with your preferences via `sudo nano config/config.json`
|
<details>
|
||||||
|
|
||||||
###API Keys
|
<summary>Configuration</summary>
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
### Initial Setup
|
||||||
|
|
||||||
|
The system uses a template-based configuration approach to avoid Git conflicts during updates:
|
||||||
|
|
||||||
|
1. **First-time setup**: The previous "First_time_install.sh" script should've already copied the template to create your config.json:
|
||||||
|
|
||||||
|
2. **Edit your configuration**:
|
||||||
|
```bash
|
||||||
|
sudo nano config/config.json
|
||||||
|
```
|
||||||
|
or edit via web interface at http://ledpi:5001
|
||||||
|
|
||||||
|
3. **Having Issues?**: Run the First Time Script again:
|
||||||
|
```bash
|
||||||
|
sudo ./first_time_install.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### API Keys and Secrets
|
||||||
|
|
||||||
For sensitive settings like API keys:
|
For sensitive settings like API keys:
|
||||||
Copy the template: `cp config/config_secrets.template.json config/config_secrets.json`
|
1. Copy the secrets template: `cp config/config_secrets.template.json config/config_secrets.json`
|
||||||
Edit `config/config_secrets.json` with your API keys via `sudo nano config/config_secrets.json`
|
2. Edit `config/config_secrets.json` with your API keys via `sudo nano config/config_secrets.json`
|
||||||
Ctrl + X to exit, Y to overwrite, Enter to Confirm
|
3. Ctrl + X to exit, Y to overwrite, Enter to Confirm
|
||||||
|
|
||||||
Everything is configured via `config/config.json` and `config/config_secrets.json`.
|
### Automatic Configuration Migration
|
||||||
|
|
||||||
|
The system automatically handles configuration updates:
|
||||||
|
- **New installations**: Creates `config.json` from the template automatically
|
||||||
|
- **Existing installations**: Automatically adds new configuration options with default values when the system starts
|
||||||
|
- **Backup protection**: Creates a backup of your current config before applying updates
|
||||||
|
- **No conflicts**: Your custom settings are preserved while new options are added
|
||||||
|
|
||||||
|
Everything is configured via `config/config.json` and `config/config_secrets.json`. The `config.json` file is not tracked by Git to prevent conflicts during updates.
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
|
||||||
|
<details>
|
||||||
|
|
||||||
|
<summary>Calendar Display Configuration</summary>
|
||||||
|
|
||||||
-----------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
## Calendar Display Configuration
|
## Calendar Display Configuration
|
||||||
|
|
||||||
@@ -312,6 +436,11 @@ The calendar display will show:
|
|||||||
- Event date and time
|
- Event date and time
|
||||||
- Event title (wrapped to fit the display)
|
- Event title (wrapped to fit the display)
|
||||||
- Up to 3 upcoming events (configurable)
|
- Up to 3 upcoming events (configurable)
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
|
||||||
|
<summary>Odds Ticker Configuration</summary>
|
||||||
|
|
||||||
## Odds Ticker Configuration
|
## Odds Ticker Configuration
|
||||||
|
|
||||||
@@ -375,7 +504,7 @@ The ticker displays team logos alongside the text:
|
|||||||
- `assets/sports/nfl_logos/`
|
- `assets/sports/nfl_logos/`
|
||||||
- `assets/sports/nba_logos/`
|
- `assets/sports/nba_logos/`
|
||||||
- `assets/sports/mlb_logos/`
|
- `assets/sports/mlb_logos/`
|
||||||
- `assets/sports/ncaa_fbs_logos/`
|
- `assets/sports/ncaa_logos/`
|
||||||
|
|
||||||
### Troubleshooting
|
### Troubleshooting
|
||||||
|
|
||||||
@@ -407,6 +536,12 @@ This will:
|
|||||||
2. Fetch upcoming games and odds
|
2. Fetch upcoming games and odds
|
||||||
3. Display sample games
|
3. Display sample games
|
||||||
4. Test the scrolling functionality
|
4. Test the scrolling functionality
|
||||||
|
</details>
|
||||||
|
|
||||||
|
|
||||||
|
<details>
|
||||||
|
|
||||||
|
<summary>Stocks Configuration</summary>
|
||||||
|
|
||||||
## Stocks Configuration
|
## Stocks Configuration
|
||||||
|
|
||||||
@@ -509,6 +644,13 @@ This will:
|
|||||||
2. Verify configuration loading
|
2. Verify configuration loading
|
||||||
3. Test cache clearing behavior
|
3. Test cache clearing behavior
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
|
||||||
|
<summary>Football Configuration</summary>
|
||||||
|
|
||||||
|
|
||||||
## Football Game-Based Configuration (NFL & NCAA FB)
|
## Football Game-Based Configuration (NFL & NCAA FB)
|
||||||
|
|
||||||
For NFL and NCAA Football, the system now uses a game-based fetch approach instead of time-based windows. This is more practical for football since games are weekly and you want to show specific numbers of games rather than arbitrary time periods.
|
For NFL and NCAA Football, the system now uses a game-based fetch approach instead of time-based windows. This is more practical for football since games are weekly and you want to show specific numbers of games rather than arbitrary time periods.
|
||||||
@@ -558,6 +700,13 @@ Instead of using `past_fetch_days` and `future_fetch_days`, the system now uses:
|
|||||||
- **Off-Season**: `fetch_future_games: 1` shows the first scheduled game (even if it's months away)
|
- **Off-Season**: `fetch_future_games: 1` shows the first scheduled game (even if it's months away)
|
||||||
- **Planning**: `fetch_future_games: 2` shows the next two matchups for planning purposes
|
- **Planning**: `fetch_future_games: 2` shows the next two matchups for planning purposes
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
|
||||||
|
<details>
|
||||||
|
|
||||||
|
<summary> Music Display Configuration </summary>
|
||||||
|
|
||||||
## Music Display Configuration
|
## Music Display Configuration
|
||||||
|
|
||||||
The Music Display module shows information about the currently playing track from either Spotify or YouTube Music (via the [YouTube Music Desktop App](https://ytmdesktop.app/) companion server).
|
The Music Display module shows information about the currently playing track from either Spotify or YouTube Music (via the [YouTube Music Desktop App](https://ytmdesktop.app/) companion server).
|
||||||
@@ -694,105 +843,9 @@ To get these credentials:
|
|||||||
* Connection errors: Double-check the `YTM_COMPANION_URL` in `config.json` matches what YTMD's companion server is set to.
|
* Connection errors: Double-check the `YTM_COMPANION_URL` in `config.json` matches what YTMD's companion server is set to.
|
||||||
* Ensure your firewall (Windows Firewall) allows YTM Desktop app to access local networks.
|
* Ensure your firewall (Windows Firewall) allows YTM Desktop app to access local networks.
|
||||||
|
|
||||||
-----------------------------------------------------------------------------------
|
</details>
|
||||||
### Favorite Team Filtering
|
|
||||||
Across all sports displays (NFL, MLB, NBA, etc.), you can control which games are shown using the `"show_favorite_teams_only"` and `"favorite_teams"` settings in your `config/config.json`.
|
|
||||||
|
|
||||||
**How it Works:**
|
|
||||||
|
|
||||||
* **`"show_favorite_teams_only": true`**: When this is set to `true` within a specific sport's configuration (e.g., in the `"nfl_scoreboard"` block), the system will **only** fetch and display games (Live, Recent, and Upcoming) that involve one of the teams listed in your `"favorite_teams"` array for that sport. This is the best way to reduce API calls and keep the display focused.
|
|
||||||
|
|
||||||
* **`"show_favorite_teams_only": false`**: When set to `false` (or omitted), the system will display **all** available games for that sport, ignoring the `"favorite_teams"` list completely.
|
|
||||||
|
|
||||||
**Example `config.json` for NFL:**
|
|
||||||
```json
|
|
||||||
"nfl_scoreboard": {
|
|
||||||
"enabled": true,
|
|
||||||
"show_odds": true,
|
|
||||||
"show_favorite_teams_only": true, // <-- Only shows games for DAL & TB
|
|
||||||
"favorite_teams": ["DAL", "TB"],
|
|
||||||
"fetch_past_games": 1,
|
|
||||||
"fetch_future_games": 1
|
|
||||||
},
|
|
||||||
```
|
|
||||||
|
|
||||||
### Odds Ticker Feature
|
|
||||||
The system includes a comprehensive odds ticker that displays betting odds for upcoming sports games. The ticker respects the `show_favorite_teams_only` setting from each individual sports module. For example, if `"show_favorite_teams_only": true` is set in the `nfl_scoreboard` config, the odds ticker will only show odds for your favorite NFL teams.
|
|
||||||
|
|
||||||
**Features:**
|
|
||||||
- **Multi-League Support**: NFL, NBA, MLB, NCAA Football
|
|
||||||
- **Configurable Leagues**: Choose which leagues to display
|
|
||||||
- **Favorite Teams Filter**: Obeys the `show_favorite_teams_only` setting in each sport's configuration block.
|
|
||||||
- **Team Logos**: Displays team logos alongside odds information
|
|
||||||
- **Comprehensive Odds**: Shows spreads, money lines, and over/under totals
|
|
||||||
- **Scrolling Display**: Smooth scrolling text with team logos
|
|
||||||
- **Time Display**: Shows game times in local timezone
|
|
||||||
|
|
||||||
**Display Format:**
|
|
||||||
```
|
|
||||||
[12:00 PM] DAL -6.5 ML -200 O/U 47.5 vs NYG ML +175
|
|
||||||
```
|
|
||||||
|
|
||||||
**Configuration:**
|
|
||||||
Add the following section to your `config/config.json`:
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"odds_ticker": {
|
|
||||||
"enabled": true,
|
|
||||||
"enabled_leagues": ["nfl", "nba", "mlb", "ncaa_fb"],
|
|
||||||
"update_interval": 3600,
|
|
||||||
"scroll_speed": 2,
|
|
||||||
"scroll_delay": 0.05,
|
|
||||||
"display_duration": 30
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**Testing:**
|
|
||||||
You can test the odds ticker functionality using:
|
|
||||||
```bash
|
|
||||||
python test_odds_ticker.py
|
|
||||||
```
|
|
||||||
|
|
||||||
### Persistent Caching Setup
|
|
||||||
|
|
||||||
The LEDMatrix system uses persistent caching to improve performance and reduce API calls. When running with `sudo`, the system needs a persistent cache directory that survives restarts.
|
|
||||||
|
|
||||||
**First-Time Setup:**
|
|
||||||
Run the setup script to create a persistent cache directory:
|
|
||||||
```bash
|
|
||||||
chmod +x setup_cache.sh
|
|
||||||
./setup_cache.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
This will:
|
|
||||||
- Create `/var/cache/ledmatrix/` directory
|
|
||||||
- Set proper ownership to your user account
|
|
||||||
- Set permissions to allow the daemon user (which the system runs as) to write
|
|
||||||
- Test writability for both your user and the daemon user
|
|
||||||
|
|
||||||
**If You Still See Cache Warnings:**
|
|
||||||
If you see warnings about using temporary cache directory, run the permissions fix:
|
|
||||||
```bash
|
|
||||||
chmod +x fix_cache_permissions.sh
|
|
||||||
./fix_cache_permissions.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
**Manual Setup:**
|
|
||||||
If you prefer to set up manually:
|
|
||||||
```bash
|
|
||||||
sudo mkdir -p /var/cache/ledmatrix
|
|
||||||
sudo chown $USER:$USER /var/cache/ledmatrix
|
|
||||||
sudo chmod 777 /var/cache/ledmatrix
|
|
||||||
```
|
|
||||||
|
|
||||||
**Cache Locations (in order of preference):**
|
|
||||||
1. `~/.ledmatrix_cache/` (user's home directory) - **Most persistent**
|
|
||||||
2. `/var/cache/ledmatrix/` (system cache directory) - **Persistent across restarts**
|
|
||||||
3. `/opt/ledmatrix/cache/` (alternative persistent location)
|
|
||||||
4. `/tmp/ledmatrix_cache/` (temporary directory) - **NOT persistent**
|
|
||||||
|
|
||||||
**Note:** If the system falls back to `/tmp/ledmatrix_cache/`, you'll see a warning message and the cache will not persist across restarts.
|
|
||||||
------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------
|
||||||
## Before Running the Display
|
## Before Running the Display
|
||||||
- To allow the script to properly access fonts, you need to set the correct permissions on your home directory:
|
- To allow the script to properly access fonts, you need to set the correct permissions on your home directory:
|
||||||
@@ -815,6 +868,10 @@ This will start the display cycle but only stays active as long as your ssh sess
|
|||||||
|
|
||||||
-----------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
<details>
|
||||||
|
|
||||||
|
<summary>Run on Startup Automatically with Systemd Service Installation</summary>
|
||||||
|
|
||||||
|
|
||||||
## Run on Startup Automatically with Systemd Service Installation
|
## Run on Startup Automatically with Systemd Service Installation
|
||||||
|
|
||||||
@@ -861,6 +918,12 @@ sudo systemctl disable ledmatrix.service
|
|||||||
# Enable autostart
|
# Enable autostart
|
||||||
sudo systemctl enable ledmatrix.service
|
sudo systemctl enable ledmatrix.service
|
||||||
```
|
```
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
|
||||||
|
<summary>Convenience Scripts</summary>
|
||||||
|
|
||||||
|
|
||||||
### Convenience Scripts
|
### Convenience Scripts
|
||||||
|
|
||||||
@@ -879,12 +942,12 @@ Then use them to control the service:
|
|||||||
sudo ./start_display.sh
|
sudo ./start_display.sh
|
||||||
sudo ./stop_display.sh
|
sudo ./stop_display.sh
|
||||||
```
|
```
|
||||||
|
</details>
|
||||||
-----------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------
|
||||||
|
|
||||||
## Web Interface Installation
|
## Web Interface Installation (V2)
|
||||||
|
|
||||||
The LEDMatrix system includes a web interface that allows you to control and configure the display remotely. The web interface runs on port 5001 and provides real-time display preview, configuration management, and on-demand display controls.
|
The LEDMatrix system includes Web Interface V2 that runs on port 5001 and provides real-time display preview, configuration management, and on-demand display controls.
|
||||||
|
|
||||||
### Installing the Web Interface Service
|
### Installing the Web Interface Service
|
||||||
|
|
||||||
@@ -979,35 +1042,14 @@ sudo systemctl enable ledmatrix-web.service
|
|||||||
|
|
||||||
-----------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------
|
||||||
|
|
||||||
## Custom Fonts
|
|
||||||
You can add any font to the assets/fonts/ folder but they need to be .ttf or .btf(less support) and updated in display_manager.py
|
|
||||||
|
|
||||||
|
## Information
|
||||||
|
|
||||||
|
<details>
|
||||||
|
|
||||||
-----------------------------------------------------------------------------------
|
<summary>Display Settings from RGBLEDMatrix Library</summary>
|
||||||
|
|
||||||
|
|
||||||
### Running the display without Sudo (Not recommended but can be useful for troubleshooting or overcoming write errors)
|
|
||||||
|
|
||||||
To run the display script without `sudo`, the user executing the script needs access to GPIO pins. Add the user to the `gpio` group:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo usermod -a -G gpio <your_username>
|
|
||||||
# Example for user 'ledpi':
|
|
||||||
# sudo usermod -a -G gpio ledpi
|
|
||||||
```
|
|
||||||
|
|
||||||
**Important:** You must **reboot** the Raspberry Pi after adding the user to the group for the change to take effect.
|
|
||||||
|
|
||||||
You also need to disable hardware pulsing in the code (see `src/display_manager.py`, set `options.disable_hardware_pulsing = True`). This may result in a flickerying display
|
|
||||||
|
|
||||||
If configured correctly, you can then run:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
python3 display_controller.py
|
|
||||||
```
|
|
||||||
-----------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
## Display Settings
|
## Display Settings
|
||||||
If you are copying my setup, you can likely leave this alone.
|
If you are copying my setup, you can likely leave this alone.
|
||||||
- hardware: Configures how the matrix is driven.
|
- hardware: Configures how the matrix is driven.
|
||||||
@@ -1025,147 +1067,54 @@ If you are copying my setup, you can likely leave this alone.
|
|||||||
- Sports modules also support test_mode, live_update_interval, and favorite_teams.
|
- Sports modules also support test_mode, live_update_interval, and favorite_teams.
|
||||||
- Logos are loaded from the logo_dir path under assets/sports/...
|
- Logos are loaded from the logo_dir path under assets/sports/...
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
|
||||||
|
<details>
|
||||||
|
|
||||||
|
<summary>Cache Information</summary>
|
||||||
|
|
||||||
|
|
||||||
|
### Persistent Caching Setup
|
||||||
|
|
||||||
|
The LEDMatrix system uses persistent caching to improve performance and reduce API calls. When running with `sudo`, the system needs a persistent cache directory that survives restarts.
|
||||||
|
|
||||||
|
**First-Time Setup:**
|
||||||
|
Run the setup script to create a persistent cache directory:
|
||||||
```bash
|
```bash
|
||||||
Example: NHL Configuration"nhl_scoreboard": {
|
chmod +x setup_cache.sh
|
||||||
"enabled": true,
|
./setup_cache.sh
|
||||||
"test_mode": false,
|
|
||||||
"update_interval_seconds": 300,
|
|
||||||
"live_update_interval": 15,
|
|
||||||
"recent_game_hours": 48,
|
|
||||||
"favorite_teams": ["TB", "DAL"],
|
|
||||||
"logo_dir": "assets/sports/nhl_logos",
|
|
||||||
"display_modes": {
|
|
||||||
"nhl_live": true,
|
|
||||||
"nhl_recent": true,
|
|
||||||
"nhl_upcoming": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Date Format Configuration
|
This will:
|
||||||
|
- Create `/var/cache/ledmatrix/` directory
|
||||||
|
- Set proper ownership to your user account
|
||||||
|
- Set permissions to allow the daemon user (which the system runs as) to write
|
||||||
|
- Test writability for both your user and the daemon user
|
||||||
|
|
||||||
You can customize the date format for upcoming games across all sports displays. The `use_short_date_format` setting in `config/config.json` under the `display` section controls this behavior.
|
**If You Still See Cache Warnings:**
|
||||||
|
If you see warnings about using temporary cache directory, run the permissions fix:
|
||||||
- **`"use_short_date_format": true`**: Displays dates in a short, numerical format (e.g., "8/30").
|
```bash
|
||||||
- **`"use_short_date_format": false`** (Default): Displays dates in a more descriptive format with an ordinal suffix (e.g., "Aug 30th").
|
chmod +x fix_cache_permissions.sh
|
||||||
|
./fix_cache_permissions.sh
|
||||||
### Example `config.json`
|
|
||||||
|
|
||||||
```json
|
|
||||||
"display": {
|
|
||||||
"hardware": {
|
|
||||||
...
|
|
||||||
},
|
|
||||||
"runtime": {
|
|
||||||
...
|
|
||||||
},
|
|
||||||
"display_durations": {
|
|
||||||
...
|
|
||||||
},
|
|
||||||
"use_short_date_format": false // Set to true for "8/30" format
|
|
||||||
},
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**Manual Setup:**
|
||||||
## Project Structure
|
If you prefer to set up manually:
|
||||||
|
```bash
|
||||||
```
|
sudo mkdir -p /var/cache/ledmatrix
|
||||||
LEDMatrix/
|
sudo chown $USER:$USER /var/cache/ledmatrix
|
||||||
├── assets/ # Static assets like fonts and icons
|
sudo chmod 777 /var/cache/ledmatrix
|
||||||
├── config/ # Configuration files
|
|
||||||
│ ├── config.json # Main configuration
|
|
||||||
│ └── config_secrets.template.json # Template for API keys and sensitive data
|
|
||||||
├── src/ # Source code
|
|
||||||
│ ├── display_controller.py # Main application controller
|
|
||||||
│ ├── config_manager.py # Configuration management
|
|
||||||
│ ├── display_manager.py # LED matrix display handling
|
|
||||||
│ ├── cache_manager.py # Caching system for API data
|
|
||||||
│ ├── clock.py # Clock display module
|
|
||||||
│ ├── weather_manager.py # Weather display module
|
|
||||||
│ ├── weather_icons.py # Weather icon definitions
|
|
||||||
│ ├── stock_manager.py # Stock ticker display module
|
|
||||||
│ ├── stock_news_manager.py # Stock news display module
|
|
||||||
│ ├── music_manager.py # Music display orchestration
|
|
||||||
│ ├── spotify_client.py # Spotify API integration
|
|
||||||
│ ├── ytm_client.py # YouTube Music integration
|
|
||||||
│ ├── authenticate_spotify.py # Spotify authentication
|
|
||||||
│ ├── authenticate_ytm.py # YouTube Music authentication
|
|
||||||
│ ├── calendar_manager.py # Google Calendar integration
|
|
||||||
│ ├── youtube_display.py # YouTube channel stats display
|
|
||||||
│ ├── text_display.py # Custom text display module
|
|
||||||
│ ├── font_test_manager.py # Font testing utility
|
|
||||||
│ ├── nhl_managers.py # NHL game display
|
|
||||||
│ ├── nba_managers.py # NBA game display
|
|
||||||
│ ├── mlb_manager.py # MLB game display
|
|
||||||
│ ├── nfl_managers.py # NFL game display
|
|
||||||
│ ├── soccer_managers.py # Soccer game display
|
|
||||||
│ ├── ncaa_fb_managers.py # NCAA Football display
|
|
||||||
│ ├── ncaa_baseball_managers.py # NCAA Baseball display
|
|
||||||
│ └── ncaam_basketball_managers.py # NCAA Basketball display
|
|
||||||
├── rpi-rgb-led-matrix-master/ # LED matrix library
|
|
||||||
├── run.py # Main entry point
|
|
||||||
├── display_controller.py # Legacy entry point
|
|
||||||
├── calendar_registration.py # Calendar API setup
|
|
||||||
├── run_font_test.py # Font testing entry point
|
|
||||||
├── ChuckBuilds.py # Custom display module
|
|
||||||
├── start_display.sh # Service start script
|
|
||||||
├── stop_display.sh # Service stop script
|
|
||||||
├── install_service.sh # Service installation script
|
|
||||||
├── ledmatrix.service # Systemd service definition
|
|
||||||
├── requirements.txt # Python dependencies
|
|
||||||
└── config.example.json # Example configuration
|
|
||||||
```
|
```
|
||||||
|
|
||||||
The project is organized into several key components:
|
**Cache Locations (in order of preference):**
|
||||||
|
1. `~/.ledmatrix_cache/` (user's home directory) - **Most persistent**
|
||||||
|
2. `/var/cache/ledmatrix/` (system cache directory) - **Persistent across restarts**
|
||||||
|
3. `/opt/ledmatrix/cache/` (alternative persistent location)
|
||||||
|
4. `/tmp/ledmatrix_cache/` (temporary directory) - **NOT persistent**
|
||||||
|
|
||||||
- `src/`: Contains all the Python source code, organized by feature
|
**Note:** If the system falls back to `/tmp/ledmatrix_cache/`, you'll see a warning message and the cache will not persist across restarts.
|
||||||
- `config/`: Configuration files for the application
|
|
||||||
- `assets/`: Static assets like fonts and icons
|
|
||||||
- `rpi-rgb-led-matrix-master/`: The LED matrix control library
|
|
||||||
- Various utility scripts for running and managing the service
|
|
||||||
|
|
||||||
Each display module in `src/` is responsible for a specific feature (weather, sports, music, etc.) and follows a consistent pattern of data fetching, processing, and display rendering.
|
|
||||||
|
|
||||||
## NHL, NBA, MLB, Soccer, NCAA FB, NCAA Men's Baseball, NCAA Men's Basketball Scoreboard Display
|
|
||||||
The LEDMatrix system includes a comprehensive scoreboard display system with three display modes:
|
|
||||||
|
|
||||||
### Display Modes
|
|
||||||
- **Live Games**: Shows currently playing games with live scores and game status
|
|
||||||
- **Recent Games**: Displays completed games from the last 48 hours (configurable)
|
|
||||||
- **Upcoming Games**: Shows scheduled games for favorite teams
|
|
||||||
|
|
||||||
### Features
|
|
||||||
- Real-time score updates from ESPN API
|
|
||||||
- Team logo display
|
|
||||||
- Game status indicators (period, time remaining)
|
|
||||||
- Configurable favorite teams
|
|
||||||
- Automatic game switching
|
|
||||||
- Built-in caching to reduce API calls
|
|
||||||
- Test mode for development
|
|
||||||
## API Usage Tracking
|
|
||||||
|
|
||||||
The LEDMatrix system includes a built-in API usage counter that tracks API calls made by various managers in a 24-hour rolling window. This feature helps monitor API usage and ensure compliance with rate limits.
|
|
||||||
|
|
||||||
### API Counter Features
|
|
||||||
- **Real-time Tracking**: Counts API calls for weather, stocks, sports, and news data
|
|
||||||
- **24-hour Window**: Rolling window that resets every 24 hours
|
|
||||||
- **Web Interface Integration**: View current usage in the Overview tab of the web interface
|
|
||||||
- **Forecast Display**: Shows predicted API usage based on current configuration
|
|
||||||
- **Automatic Reset**: Counters automatically reset when the 24-hour window expires
|
|
||||||
|
|
||||||
### Tracked API Calls
|
|
||||||
- **Weather**: OpenWeatherMap API calls (geocoding + weather data)
|
|
||||||
- **Stocks**: Yahoo Finance API calls for stock and crypto data
|
|
||||||
- **Sports**: ESPN API calls for various sports leagues (NHL, NBA, MLB, NFL, etc.)
|
|
||||||
- **News**: RSS feed and news API calls
|
|
||||||
|
|
||||||
### Accessing API Metrics
|
|
||||||
1. Open the web interface in your browser
|
|
||||||
2. Navigate to the **Overview** tab
|
|
||||||
3. Scroll down to the "API Calls (24h window)" section
|
|
||||||
4. Click "Refresh API Metrics" to update the display
|
|
||||||
|
|
||||||
The counter shows both actual usage and forecasted usage based on your current configuration settings.
|
|
||||||
|
|
||||||
## Caching System
|
## Caching System
|
||||||
|
|
||||||
@@ -1198,21 +1147,46 @@ The LEDMatrix system includes a robust caching mechanism to optimize API calls a
|
|||||||
- Temporary files are used for safe updates
|
- Temporary files are used for safe updates
|
||||||
- JSON serialization handles all data types including timestamps
|
- JSON serialization handles all data types including timestamps
|
||||||
|
|
||||||
## Final Notes
|
</details>
|
||||||
- Most configuration is done via config/config.json
|
|
||||||
- Refresh intervals for sports/weather/stocks are customizable
|
|
||||||
- A caching system reduces API strain and helps ensure the display doesn't hammer external services (and ruin it for everyone)
|
|
||||||
- Font files should be placed in assets/fonts/
|
|
||||||
- You can test each module individually for debugging
|
|
||||||
|
|
||||||
|
|
||||||
##What's Next?
|
|
||||||
- Adding MQTT/HomeAssistant integration
|
|
||||||
- Gambling odds (done!)
|
|
||||||
- Building a user-friendly UI for easier configuration (done!)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<details>
|
||||||
|
|
||||||
|
<summary>Date Format Configuration </summary>
|
||||||
|
|
||||||
|
## Date Format Configuration
|
||||||
|
|
||||||
|
You can customize the date format for upcoming games across all sports displays. The `use_short_date_format` setting in `config/config.json` under the `display` section controls this behavior.
|
||||||
|
|
||||||
|
- **`"use_short_date_format": true`**: Displays dates in a short, numerical format (e.g., "8/30").
|
||||||
|
- **`"use_short_date_format": false`** (Default): Displays dates in a more descriptive format with an ordinal suffix (e.g., "Aug 30th").
|
||||||
|
|
||||||
|
### Example `config.json`
|
||||||
|
|
||||||
|
```json
|
||||||
|
"display": {
|
||||||
|
"hardware": {
|
||||||
|
...
|
||||||
|
},
|
||||||
|
"runtime": {
|
||||||
|
...
|
||||||
|
},
|
||||||
|
"display_durations": {
|
||||||
|
...
|
||||||
|
},
|
||||||
|
"use_short_date_format": false // Set to true for "8/30" format
|
||||||
|
},
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
|
||||||
|
-----------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
<details>
|
||||||
|
|
||||||
|
<summary>Passwordless Sudo for Web Interface Actions</summary>
|
||||||
|
|
||||||
## Granting Passwordless Sudo Access for Web Interface Actions
|
## Granting Passwordless Sudo Access for Web Interface Actions
|
||||||
|
|
||||||
@@ -1274,10 +1248,12 @@ Manual Method:
|
|||||||
Granting passwordless `sudo` access, even for specific commands, has security implications. Ensure that the scripts and commands allowed are secure and cannot be easily exploited. The web interface itself should also be secured if it's exposed to untrusted networks.
|
Granting passwordless `sudo` access, even for specific commands, has security implications. Ensure that the scripts and commands allowed are secure and cannot be easily exploited. The web interface itself should also be secured if it's exposed to untrusted networks.
|
||||||
For `display_controller.py` and `stop_display.sh`, ensure their file permissions restrict write access to only trusted users, preventing unauthorized modification of these scripts which run with elevated privileges.
|
For `display_controller.py` and `stop_display.sh`, ensure their file permissions restrict write access to only trusted users, preventing unauthorized modification of these scripts which run with elevated privileges.
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
|
||||||
## Web Interface V2 (simplified quick start)
|
## Web Interface V2 (simplified quick start)
|
||||||
|
|
||||||
### 1) un the helper (does the above and starts the server):
|
### 1) Run the helper (does the above and starts the server):
|
||||||
```
|
```
|
||||||
python3 start_web_v2.py
|
python3 start_web_v2.py
|
||||||
```
|
```
|
||||||
@@ -1287,18 +1263,29 @@ python3 start_web_v2.py
|
|||||||
python web_interface_v2.py
|
python web_interface_v2.py
|
||||||
```
|
```
|
||||||
|
|
||||||
### 3) Autostart (optional)
|
### 3) Autostart (recommended)
|
||||||
Set `"web_display_autostart": true` in `config/config.json`.
|
Set `"web_display_autostart": true` in `config/config.json`.
|
||||||
Ensure your systemd service (or launcher) calls `start_web_conditionally.py`.
|
Ensure your systemd service calls `start_web_conditionally.py` (installed by `install_service.sh`).
|
||||||
|
|
||||||
### 4) Permissions (optional but recommended)
|
### 4) Permissions (optional but recommended)
|
||||||
- Add the service user to `systemd-journal` for viewing logs without sudo.
|
- Add the service user to `systemd-journal` for viewing logs without sudo.
|
||||||
- Configure passwordless sudo for actions (start/stop service, reboot, shutdown) if desired.
|
- Configure passwordless sudo for actions (start/stop service, reboot, shutdown) if desired.
|
||||||
- Required for web Ui actions, look in the section above for the commands to run (chmod +x configure_web_sudo.sh & ./configure_web_sudo.sh)
|
- Required for web Ui actions, look in the section above for the commands to run (chmod +x configure_web_sudo.sh & ./configure_web_sudo.sh)
|
||||||
|
|
||||||
### 5) Old web UI (v1)
|
|
||||||
The project now defaults to Web UI v2. The v1 interface can be ignored.
|
|
||||||
An LED matrix display system that provides real-time information display capabilities for various data sources. The system is highly configurable and supports multiple display modes that can be enabled or disabled based on user preferences.
|
|
||||||
|
|
||||||
|
|
||||||
### If you've read this far — thanks!
|
|
||||||
|
## Final Notes
|
||||||
|
- Most configuration is done via config/config.json
|
||||||
|
- Refresh intervals for sports/weather/stocks are customizable
|
||||||
|
- A caching system reduces API strain and helps ensure the display doesn't hammer external services (and ruin it for everyone)
|
||||||
|
- Font files should be placed in assets/fonts/
|
||||||
|
- You can test each module individually for debugging
|
||||||
|
|
||||||
|
|
||||||
|
##What's Next?
|
||||||
|
- Adding MQTT/HomeAssistant integration
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### If you've read this far — thanks!
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 9.9 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 11 KiB |
BIN
assets/broadcast_logos/paramount-plus.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
assets/broadcast_logos/prime.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 4.3 KiB |
BIN
assets/news_logos/cbc.png
Normal file
|
After Width: | Height: | Size: 40 KiB |
BIN
assets/news_logos/cnn.png
Normal file
|
After Width: | Height: | Size: 56 KiB |
@@ -1,404 +1,53 @@
|
|||||||
NCAAF
|
NCAAF
|
||||||
AAMU => Alabama A&M Bulldogs
|
AMH => Amherst Mammoths
|
||||||
ACU => Abilene Christian Wildcats
|
|
||||||
ADA => Adams State Grizzlies
|
|
||||||
ADR => Adrian Bulldogs
|
|
||||||
AFA => Air Force Falcons
|
|
||||||
AIC => American International Yellow Jackets
|
|
||||||
AKR => Akron Zips
|
|
||||||
ALA => Alabama Crimson Tide
|
|
||||||
ALB => Albright Lions
|
|
||||||
ALBS => Albany State (GA) Golden Rams
|
|
||||||
ALCN => Alcorn State Braves
|
|
||||||
ALD => Alderson Broaddus Battlers
|
|
||||||
ALF => Alfred Saxons
|
|
||||||
ALL => Allegheny Gators
|
|
||||||
ALST => Alabama State Hornets
|
|
||||||
AMH => Amherst College Mammoths
|
|
||||||
AND => Anderson (IN) Ravens
|
|
||||||
ANG => Angelo State Rams
|
|
||||||
ANN => Anna Maria College Amcats
|
ANN => Anna Maria College Amcats
|
||||||
APP => Appalachian State Mountaineers
|
|
||||||
APSU => Austin Peay Governors
|
|
||||||
ARIZ => Arizona Wildcats
|
ARIZ => Arizona Wildcats
|
||||||
ARK => Arkansas-Monticello Boll Weevils
|
ARK => Arkansas Razorbacks
|
||||||
ARMY => Army Black Knights
|
|
||||||
ARST => Arkansas State Red Wolves
|
|
||||||
ASH => Ashland Eagles
|
|
||||||
ASP => Assumption Greyhounds
|
|
||||||
ASU => Arizona State Sun Devils
|
ASU => Arizona State Sun Devils
|
||||||
AUB => Auburn Tigers
|
AUB => Auburn Tigers
|
||||||
AUG => St. Augustine's Falcons
|
BOIS => Boise State Broncos
|
||||||
AUR => Aurora Spartans
|
BRST => Bridgewater State Bears
|
||||||
AUS => Austin College 'Roos
|
BUENA => Buena Vista Beavers
|
||||||
AVE => Averett Cougars
|
CAL => California Golden Bears
|
||||||
AVI => Avila College Eagles
|
CAR => Carroll University (WI) Pioneers
|
||||||
AZU => Azusa Pacific Cougars
|
CLA => Claremont-Mudd-Scripps College Stags
|
||||||
BAK => Baker University Wildcats
|
COLBY => Colby College White Mules
|
||||||
BAL => Baldwin Wallace Yellow Jackets
|
|
||||||
BALL => Ball State Cardinals
|
|
||||||
BAT => Bates College Bobcats
|
|
||||||
BAY => Baylor Bears
|
|
||||||
BC => Boston College Eagles
|
|
||||||
BEC => Becker College Hawks
|
|
||||||
BEL => Beloit College Buccaneers
|
|
||||||
BEN => Benedictine University (IL) Eagles
|
|
||||||
BENT => Bentley Falcons
|
|
||||||
BET => Bethel (TN) Wildcats
|
|
||||||
BGSU => Bowling Green Falcons
|
|
||||||
BHS => Black Hills State Yellow Jackets
|
|
||||||
BIR => Birmingham-Southern Panthers
|
|
||||||
BKN => Bacone College Warriors
|
|
||||||
BLA => Blackburn Beavers
|
|
||||||
BLOM => Bloomsburg Huskies
|
|
||||||
BLU => Bluffton Beavers
|
|
||||||
BOW => Bowdoin Polar Bears
|
|
||||||
BRI => British Columbia Thunderbirds
|
|
||||||
BRWN => Brown Bears
|
|
||||||
BST => Bemidji State Beavers
|
|
||||||
BSU => Bowie State Bulldogs
|
|
||||||
BUCK => Bucknell Bison
|
|
||||||
BUE => Buena Vista Beavers
|
|
||||||
BUF => Buffalo State Bengals
|
|
||||||
BUFF => Buffalo Bulls
|
|
||||||
BUT => Butler Bulldogs
|
|
||||||
BYU => BYU Cougars
|
|
||||||
CAL => California Lutheran Kingsmen
|
|
||||||
CAM => Campbell Fighting Camels
|
|
||||||
CAP => Capital University Crusaders
|
|
||||||
CAR => Carthage College Red Men
|
|
||||||
CARK => Central Arkansas Bears
|
|
||||||
CAS => Castleton Spartans
|
|
||||||
CAT => Catholic University Cardinals
|
|
||||||
CCSU => Central Connecticut Blue Devils
|
|
||||||
CCU => Coastal Carolina Chanticleers
|
|
||||||
CEN => Centre College Colonels
|
|
||||||
CHA => Chapman University Panthers
|
|
||||||
CHI => Chicago Maroons
|
|
||||||
CHSO => Charleston Southern Buccaneers
|
|
||||||
CIN => Cincinnati Bearcats
|
|
||||||
CLA => Clarion Golden Eagles
|
|
||||||
CLEM => Clemson Tigers
|
|
||||||
CLMB => Columbia Lions
|
|
||||||
CLT => Charlotte 49ers
|
|
||||||
CMU => Central Michigan Chippewas
|
|
||||||
COE => Coe College Kohawks
|
|
||||||
COL => Colorado School of Mines Orediggers
|
|
||||||
COLC => Colorado College Tigers
|
|
||||||
COLG => Colgate Raiders
|
|
||||||
COLO => Colorado Buffaloes
|
COLO => Colorado Buffaloes
|
||||||
CON => Concordia-Minnesota Cobbers
|
CONN => UConn Huskies
|
||||||
COR => Cornell College (IA) Rams
|
|
||||||
CP => Cal Poly Mustangs
|
CP => Cal Poly Mustangs
|
||||||
CRO => Crown Storm
|
|
||||||
CSU => Colorado State Rams
|
CSU => Colorado State Rams
|
||||||
CUL => Culver-Stockton Wildcats
|
|
||||||
CUM => Cumberland College Indians
|
|
||||||
CUR => Curry College Colonels
|
CUR => Curry College Colonels
|
||||||
DAK => Dakota Wesleyan Tigers
|
DEL => Delaware Blue Hens
|
||||||
DART => Dartmouth Big Green
|
|
||||||
DAV => Davidson Wildcats
|
|
||||||
DAY => Dayton Flyers
|
|
||||||
DEF => Defiance Yellow Jackets
|
|
||||||
DEL => Delta State Statesmen
|
|
||||||
DEN => Denison Big Red
|
|
||||||
DEP => DePauw Tigers
|
|
||||||
DIC => Dickinson State Blue Hawks
|
|
||||||
DRKE => Drake Bulldogs
|
|
||||||
DSU => Delaware State Hornets
|
|
||||||
DUB => Dubuque Spartans
|
DUB => Dubuque Spartans
|
||||||
DUKE => Duke Blue Devils
|
ELM => Elmhurst Bluejays
|
||||||
DUQ => Duquesne Dukes
|
FAMU => Florida A&M Rattlers
|
||||||
EAS => Eastern New Mexico Greyhounds
|
|
||||||
ECU => East Carolina Pirates
|
|
||||||
EDI => Edinboro Fighting Scots
|
|
||||||
EIU => Eastern Illinois Panthers
|
|
||||||
EKU => Eastern Kentucky Colonels
|
|
||||||
ELI => Elizabeth City State Vikings
|
|
||||||
ELM => Elmhurst Blue Jays
|
|
||||||
ELON => Elon Phoenix
|
|
||||||
EMO => Emory & Henry Wasps
|
|
||||||
EMP => Emporia State Hornets
|
|
||||||
EMU => Eastern Michigan Eagles
|
|
||||||
END => Endicott College Gulls
|
|
||||||
EOR => Eastern Oregon Mountaineers
|
|
||||||
ETSU => East Tennessee State Buccaneers
|
|
||||||
EUR => Eureka College Red Devils
|
|
||||||
EWU => Eastern Washington Eagles
|
|
||||||
FAU => Florida Atlantic Owls
|
|
||||||
FAY => Fayetteville State Broncos
|
|
||||||
FDU => FDU-Florham Devils
|
|
||||||
FER => Ferrum Panthers
|
|
||||||
FIN => Findlay Oilers
|
|
||||||
FIT => Fitchburg State Falcons
|
|
||||||
FIU => Florida International Panthers
|
|
||||||
FLA => Florida Gators
|
FLA => Florida Gators
|
||||||
FOR => Fort Valley State Wildcats
|
|
||||||
FRA => Franklin Grizzlies
|
|
||||||
FRES => Fresno State Bulldogs
|
|
||||||
FRO => Frostburg State Bobcats
|
|
||||||
FRST => Ferris State Bulldogs
|
|
||||||
FSU => Florida State Seminoles
|
FSU => Florida State Seminoles
|
||||||
FTLW => Fort Lewis Skyhawks
|
|
||||||
FUR => Furman Paladins
|
|
||||||
GAL => Gallaudet Bison
|
|
||||||
GAN => Gannon Golden Knights
|
|
||||||
GASO => Georgia Southern Eagles
|
|
||||||
GAST => Georgia State Panthers
|
|
||||||
GEN => Geneva College Golden Tornadoes
|
|
||||||
GEO => George Fox University Bruins
|
|
||||||
GET => Gettysburg Bullets
|
|
||||||
GLE => Glenville State Pioneers
|
|
||||||
GMU => George Mason Patriots
|
|
||||||
GRA => Grand Valley State Lakers
|
|
||||||
GRE => Greenville Panthers
|
|
||||||
GRI => Grinnell Pioneers
|
GRI => Grinnell Pioneers
|
||||||
GRO => Grove City College Wolverines
|
|
||||||
GT => Georgia Tech Yellow Jackets
|
GT => Georgia Tech Yellow Jackets
|
||||||
GUI => Guilford Quakers
|
GTWN => Georgetown Hoyas
|
||||||
GWEB => Gardner-Webb Bulldogs
|
|
||||||
HAM => Hampden-Sydney Tigers
|
|
||||||
HAMP => Hampton Pirates
|
|
||||||
HAN => Hanover Panthers
|
|
||||||
HAR => Hartwick Hawks
|
|
||||||
HARV => Harvard Crimson
|
|
||||||
HAS => Haskell Indian Nations Jayhawks
|
|
||||||
HAW => Hawai'i Rainbow Warriors
|
HAW => Hawai'i Rainbow Warriors
|
||||||
HBU => Houston Baptist Huskies
|
|
||||||
HC => Holy Cross Crusaders
|
|
||||||
HEI => Heidelberg Student Princes
|
|
||||||
HEN => Hendrix College Warriors
|
|
||||||
HIL => Hillsdale Chargers
|
|
||||||
HIR => Hiram College Terriers
|
|
||||||
HOB => Hobart Statesmen
|
|
||||||
HOU => Houston Cougars
|
|
||||||
HOW => Howard Bison
|
HOW => Howard Bison
|
||||||
HUS => Husson Eagles
|
|
||||||
IDHO => Idaho Vandals
|
IDHO => Idaho Vandals
|
||||||
IDST => Idaho State Bengals
|
|
||||||
ILL => Illinois Fighting Illini
|
|
||||||
ILST => Illinois State Redbirds
|
|
||||||
ILW => Illinois Wesleyan Titans
|
|
||||||
IND => Indianapolis
|
|
||||||
INST => Indiana State Sycamores
|
|
||||||
IOW => Iowa Wesleyan Tigers
|
|
||||||
IOWA => Iowa Hawkeyes
|
|
||||||
ISU => Iowa State Cyclones
|
ISU => Iowa State Cyclones
|
||||||
ITH => Ithaca Bombers
|
JXST => Jacksonville State Gamecocks
|
||||||
IU => Indiana Hoosiers
|
|
||||||
JKST => Jackson State Tigers
|
|
||||||
JMU => James Madison Dukes
|
|
||||||
JOH => Johnson C Smith Golden Bulls
|
|
||||||
JUN => Juniata Eagles
|
|
||||||
JVST => Jacksonville State Gamecocks
|
|
||||||
KAL => Kalamazoo Hornets
|
|
||||||
KAN => Kansas Wesleyan University Coyotes
|
|
||||||
KEN => Kenyon Lords
|
|
||||||
KENN => Kennesaw State Owls
|
|
||||||
KENT => Kent State Golden Flashes
|
|
||||||
KIN => King's College (PA) Monarchs
|
|
||||||
KNO => Knox College Prairie Fire
|
|
||||||
KSU => Kansas State Wildcats
|
|
||||||
KU => Kansas Jayhawks
|
|
||||||
KUT => Kutztown Golden Bears
|
|
||||||
KYST => Kentucky State Thorobreds
|
|
||||||
KYW => Kentucky Wesleyan Panthers
|
|
||||||
LA => La Verne Leopards
|
|
||||||
LAC => Lane Dragons
|
|
||||||
LAF => Lafayette Leopards
|
|
||||||
LAG => LaGrange College Panthers
|
|
||||||
LAK => Lake Forest Foresters
|
|
||||||
LAM => Lambuth Eagles
|
|
||||||
LAN => Langston Lions
|
|
||||||
LAW => Lawrence Vikings
|
|
||||||
LEB => Lebanon Valley Flying Dutchmen
|
|
||||||
LEH => Lehigh Mountain Hawks
|
|
||||||
LEN => Lenoir-Rhyne Bears
|
|
||||||
LEW => Lewis & Clark Pioneers
|
|
||||||
LIB => Liberty Flames
|
|
||||||
LIM => Limestone Saints
|
|
||||||
LIN => Linfield Wildcats
|
|
||||||
LOC => Lock Haven Bald Eagles
|
|
||||||
LOR => Loras College Duhawks
|
|
||||||
LOU => Louisville Cardinals
|
|
||||||
LSU => LSU Tigers
|
|
||||||
LT => Louisiana Tech Bulldogs
|
|
||||||
LUT => Luther Norse
|
LUT => Luther Norse
|
||||||
LYC => Lycoming Warriors
|
MESA => Colorado Mesa Mavericks
|
||||||
M-OH => Miami (OH) RedHawks
|
MIL => Millikin Big Blue
|
||||||
MAC => Macalester Scots
|
MOR => Morehouse College Maroon Tigers
|
||||||
MAI => Maine Maritime Mariners
|
NOR => North Park Vikings
|
||||||
MAN => Mansfield Mountaineers
|
|
||||||
MAR => Maryville College Fighting Scots
|
|
||||||
MAS => Mass Maritime Buccaneers
|
|
||||||
MASS => UMass Minutemen
|
|
||||||
MAY => Mayville State Comets
|
|
||||||
MCM => McMurry War Hawks
|
|
||||||
MCN => McNeese Cowboys
|
|
||||||
MD => Maryland Terrapins
|
|
||||||
MEM => Memphis Tigers
|
|
||||||
MEN => Menlo College Oaks
|
|
||||||
MER => Merchant Marine Mariners
|
|
||||||
MERC => Mercyhurst Lakers
|
|
||||||
MES => Colorado Mesa Mavericks
|
|
||||||
MET => Methodist Monarchs
|
|
||||||
MH => Mars Hill Mountain Lions
|
|
||||||
MIAMI => Miami Hurricanes
|
|
||||||
MICH => Michigan Wolverines
|
|
||||||
MID => Midwestern State Mustangs
|
|
||||||
MIL => Millsaps Majors
|
|
||||||
MIN => Minot State Beavers
|
|
||||||
MINN => Minnesota Golden Gophers
|
|
||||||
MIS => Missouri Western Griffons
|
|
||||||
MISS => Ole Miss Rebels
|
|
||||||
MIZ => Missouri Tigers
|
|
||||||
MNST => Minnesota State Mavericks
|
|
||||||
MONM => Monmouth Hawks
|
|
||||||
MONT => Montana Grizzlies
|
|
||||||
MOR => Morningside Chiefs
|
|
||||||
MORE => Morehead State Eagles
|
|
||||||
MORG => Morgan State Bears
|
|
||||||
MOU => Mount Union Raiders
|
|
||||||
MRSH => Marshall Thundering Herd
|
|
||||||
MRST => Marist Red Foxes
|
|
||||||
MSST => Mississippi State Bulldogs
|
|
||||||
MSU => Michigan State Spartans
|
|
||||||
MTST => Montana State Bobcats
|
|
||||||
MTSU => Middle Tennessee Blue Raiders
|
|
||||||
MTU => Michigan Tech Huskies
|
|
||||||
MUH => Muhlenberg Mules
|
|
||||||
MUR => Murray State Racers
|
|
||||||
MUS => Muskingum Fighting Muskies
|
|
||||||
MVSU => Mississippi Valley State Delta Devils
|
|
||||||
NAU => Northern Arizona Lumberjacks
|
|
||||||
NAVY => Navy Midshipmen
|
|
||||||
NBY => Newberry Wolves
|
|
||||||
NCAT => North Carolina A&T Aggies
|
|
||||||
NCCU => North Carolina Central Eagles
|
|
||||||
NCST => NC State Wolfpack
|
|
||||||
ND => Notre Dame Fighting Irish
|
|
||||||
NDOH => Notre Dame College Falcons
|
|
||||||
NDSU => North Dakota State Bison
|
|
||||||
NEB => Nebraska-Kearney Lopers
|
|
||||||
NEV => Nevada Wolf Pack
|
|
||||||
NH => New Haven Chargers
|
|
||||||
NICH => Nicholls Colonels
|
|
||||||
NIU => Northern Illinois Huskies
|
|
||||||
NMH => New Mexico Highlands Cowboys
|
|
||||||
NMI => Northern Michigan Wildcats
|
|
||||||
NMSU => New Mexico State Aggies
|
|
||||||
NOR => Univ. of Northwestern-St. Paul Eagles
|
|
||||||
NORF => Norfolk State Spartans
|
|
||||||
NW => Northwestern Wildcats
|
|
||||||
OBE => Oberlin Yeomen
|
|
||||||
ODU => Old Dominion Monarchs
|
|
||||||
OHI => Ohio Northern Polar Bears
|
|
||||||
OHIO => Ohio Bobcats
|
|
||||||
OKL => Oklahoma Baptist Bison
|
|
||||||
OKST => Oklahoma State Cowboys
|
|
||||||
OLI => Olivet College Comets
|
|
||||||
OMA => Omaha Mavericks
|
|
||||||
ORST => Oregon State Beavers
|
|
||||||
OSU => Ohio State Buckeyes
|
|
||||||
OTT => Otterbein Cardinals
|
|
||||||
OU => Oklahoma Sooners
|
|
||||||
PAC => Pacific (OR) Boxers
|
|
||||||
PENN => Pennsylvania Quakers
|
|
||||||
PIKE => Pikeville Bears
|
|
||||||
PITT => Pittsburgh Panthers
|
|
||||||
PRE => Presentation College Saints
|
|
||||||
PRI => Principia College Panthers
|
|
||||||
PRIN => Princeton Tigers
|
|
||||||
PST => Pittsburg State Gorillas
|
|
||||||
PSU => Penn State Nittany Lions
|
|
||||||
RED => Redlands Bulldogs
|
RED => Redlands Bulldogs
|
||||||
RICE => Rice Owls
|
|
||||||
RICH => Richmond Spiders
|
|
||||||
RIT => Rochester Yellow Jackets
|
|
||||||
ROB => Robert Morris (IL) Eagles
|
|
||||||
ROS => Rose-Hulman Engineers
|
|
||||||
RUTG => Rutgers Scarlet Knights
|
|
||||||
SAC => Sacramento State Hornets
|
SAC => Sacramento State Hornets
|
||||||
SAG => Saginaw Valley Cardinals
|
|
||||||
SDAK => South Dakota Coyotes
|
|
||||||
SDSU => San Diego State Aztecs
|
SDSU => San Diego State Aztecs
|
||||||
SET => Seton Hill Griffins
|
|
||||||
SIU => Southern Illinois Salukis
|
|
||||||
SJSU => San José State Spartans
|
SJSU => San José State Spartans
|
||||||
SLI => Slippery Rock The Rock
|
|
||||||
SOU => Southwestern College Moundbuilders
|
|
||||||
SPR => Springfield College Pride
|
|
||||||
ST => St. Scholastica Saints
|
|
||||||
STAN => Stanford Cardinal
|
STAN => Stanford Cardinal
|
||||||
STE => Stevenson University Mustangs
|
|
||||||
STET => Stetson Hatters
|
STET => Stetson Hatters
|
||||||
STO => Stonehill College Skyhawks
|
|
||||||
SUS => Susquehanna University River Hawks
|
|
||||||
SUU => Southern Utah Thunderbirds
|
|
||||||
SYR => Syracuse Orange
|
|
||||||
TA&M => Texas A&M Aggies
|
|
||||||
TAY => Taylor Trojans
|
|
||||||
TEM => Temple Owls
|
|
||||||
TEX => Texas Longhorns
|
|
||||||
TIF => Tiffin University Dragons
|
|
||||||
TLSA => Tulsa Golden Hurricane
|
|
||||||
TRI => Trinity University (TX) Tigers
|
|
||||||
TUF => Tufts University Jumbos
|
|
||||||
TXST => Texas State Bobcats
|
|
||||||
UAB => UAB Blazers
|
UAB => UAB Blazers
|
||||||
UAPB => Arkansas-Pine Bluff Golden Lions
|
|
||||||
UCD => UC Davis Aggies
|
|
||||||
UCF => UCF Knights
|
|
||||||
UCLA => UCLA Bruins
|
UCLA => UCLA Bruins
|
||||||
UCONN => UConn Huskies
|
|
||||||
UGA => Georgia Bulldogs
|
UGA => Georgia Bulldogs
|
||||||
UK => Kentucky Wildcats
|
|
||||||
UL => Louisiana Ragin' Cajuns
|
|
||||||
ULM => UL Monroe Warhawks
|
|
||||||
UMD => Minnesota-Duluth Bulldogs
|
|
||||||
UMDA => UMASS Dartmouth Corsairs
|
|
||||||
UML => UMass Lowell River Hawks
|
|
||||||
UNA => North Alabama Lions
|
|
||||||
UNC => North Carolina Tar Heels
|
|
||||||
UNCO => Northern Colorado Bears
|
|
||||||
UND => North Dakota Fighting Hawks
|
|
||||||
UNH => New Hampshire Wildcats
|
|
||||||
UNI => University of Mary Marauders
|
|
||||||
UNLV => UNLV Rebels
|
|
||||||
UNM => New Mexico Lobos
|
|
||||||
UNNY => Union Dutchmen
|
|
||||||
UNT => North Texas Mean Green
|
|
||||||
UPP => Upper Iowa Peacocks
|
|
||||||
URI => Rhode Island Rams
|
|
||||||
USA => South Alabama Jaguars
|
USA => South Alabama Jaguars
|
||||||
USC => USC Trojans
|
USC => USC Trojans
|
||||||
USD => San Diego Toreros
|
|
||||||
USF => South Florida Bulls
|
USF => South Florida Bulls
|
||||||
USU => Utah State Aggies
|
|
||||||
UTAH => Utah Utes
|
|
||||||
UTC => Chattanooga Mocs
|
|
||||||
UTI => Utica College Pioneers
|
|
||||||
UVA => Virginia Cavaliers
|
|
||||||
VAL => Valley City State Vikings
|
|
||||||
VAN => Vanderbilt Commodores
|
|
||||||
VILL => Villanova Wildcats
|
|
||||||
VIR => Virginia State Trojans
|
|
||||||
VT => Virginia Tech Hokies
|
|
||||||
WAB => Wabash College Little Giants
|
|
||||||
WAKE => Wake Forest Demon Deacons
|
|
||||||
WAS => Washington-Missouri Bears
|
|
||||||
WASH => Washington Huskies
|
|
||||||
WAY => Wayne State (MI) Warriors
|
|
||||||
WES => Westminster College (MO) Blue Jays
|
|
||||||
WHE => Wheaton College Illinois Thunder
|
|
||||||
WIL => Wilkes University Colonels
|
|
||||||
WIN => Wingate Bulldogs
|
|
||||||
WIS => Wisconsin-Platteville Pioneers
|
|
||||||
WISC => Wisconsin Badgers
|
|
||||||
WKU => Western Kentucky Hilltoppers
|
|
||||||
WOR => Worcester State College Lancers
|
|
||||||
WSU => Washington State Cougars
|
|
||||||
WVU => West Virginia Mountaineers
|
|
||||||
YALE => Yale Bulldogs
|
YALE => Yale Bulldogs
|
||||||
|
|
||||||
NBA
|
NBA
|
||||||
@@ -1106,6 +755,181 @@ MLB Conferences/Divisions
|
|||||||
OAK => Oakland Athletics
|
OAK => Oakland Athletics
|
||||||
SEA => Seattle Mariners
|
SEA => Seattle Mariners
|
||||||
TEX => Texas Rangers
|
TEX => Texas Rangers
|
||||||
|
|
||||||
|
Soccer Leagues:
|
||||||
|
LEAGUE_SLUGS = {
|
||||||
|
"eng.1": "Premier League",
|
||||||
|
"esp.1": "La Liga",
|
||||||
|
"ger.1": "Bundesliga",
|
||||||
|
"ita.1": "Serie A",
|
||||||
|
"fra.1": "Ligue 1",
|
||||||
|
"uefa.champions": "Champions League",
|
||||||
|
"uefa.europa": "Europa League",
|
||||||
|
"usa.1": "MLS",
|
||||||
|
"por.1": "Liga Portugal", # Add this line
|
||||||
|
}
|
||||||
|
|
||||||
|
Soccer - Premier League (England)
|
||||||
|
ARS => Arsenal
|
||||||
|
AVL => Aston Villa
|
||||||
|
BHA => Brighton & Hove Albion
|
||||||
|
BOU => AFC Bournemouth
|
||||||
|
BRE => Brentford
|
||||||
|
BUR => Burnley
|
||||||
|
CHE => Chelsea
|
||||||
|
CRY => Crystal Palace
|
||||||
|
EVE => Everton
|
||||||
|
FUL => Fulham
|
||||||
|
LIV => Liverpool
|
||||||
|
LUT => Luton Town
|
||||||
|
MCI => Manchester City
|
||||||
|
MUN => Manchester United
|
||||||
|
NEW => Newcastle United
|
||||||
|
NFO => Nottingham Forest
|
||||||
|
SHU => Sheffield United
|
||||||
|
TOT => Tottenham Hotspur
|
||||||
|
WHU => West Ham United
|
||||||
|
WOL => Wolverhampton Wanderers
|
||||||
|
|
||||||
|
Soccer - La Liga (Spain)
|
||||||
|
ALA => Alavés
|
||||||
|
ATH => Athletic Bilbao
|
||||||
|
ATM => Atlético Madrid
|
||||||
|
BAR => Barcelona
|
||||||
|
BET => Real Betis
|
||||||
|
CAG => Cagliari
|
||||||
|
CEL => Celta Vigo
|
||||||
|
ESP => Espanyol
|
||||||
|
GET => Getafe
|
||||||
|
GIR => Girona
|
||||||
|
LAZ => Lazio
|
||||||
|
LEG => Leganés
|
||||||
|
RAY => Rayo Vallecano
|
||||||
|
RMA => Real Madrid
|
||||||
|
SEV => Sevilla
|
||||||
|
VAL => Valencia
|
||||||
|
VLD => Valladolid
|
||||||
|
|
||||||
|
Soccer - Bundesliga (Germany)
|
||||||
|
BOC => VfL Bochum
|
||||||
|
BOL => VfL Bochum
|
||||||
|
DOR => Borussia Dortmund
|
||||||
|
FCA => FC Augsburg
|
||||||
|
FCB => Bayern Munich
|
||||||
|
FCU => FC Union Berlin
|
||||||
|
HAC => Hannover 96
|
||||||
|
HDH => Hertha BSC
|
||||||
|
KOL => 1. FC Köln
|
||||||
|
LEV => Bayer Leverkusen
|
||||||
|
M05 => Mainz 05
|
||||||
|
RBL => RB Leipzig
|
||||||
|
SCF => SC Freiburg
|
||||||
|
SGE => Eintracht Frankfurt
|
||||||
|
STU => VfB Stuttgart
|
||||||
|
SVW => Werder Bremen
|
||||||
|
TSG => TSG Hoffenheim
|
||||||
|
WOB => VfL Wolfsburg
|
||||||
|
|
||||||
|
Soccer - Serie A (Italy)
|
||||||
|
ATA => Atalanta
|
||||||
|
CAG => Cagliari
|
||||||
|
EMP => Empoli
|
||||||
|
FIO => Fiorentina
|
||||||
|
INT => Inter Milan
|
||||||
|
JUV => Juventus
|
||||||
|
LAZ => Lazio
|
||||||
|
MIL => AC Milan
|
||||||
|
MON => Monza
|
||||||
|
NAP => Napoli
|
||||||
|
ROM => Roma
|
||||||
|
TOR => Torino
|
||||||
|
UDI => Udinese
|
||||||
|
VER => Hellas Verona
|
||||||
|
|
||||||
|
Soccer - Ligue 1 (France)
|
||||||
|
LIL => Lille
|
||||||
|
LPM => Lille
|
||||||
|
LYON => Lyon
|
||||||
|
MAR => Marseille
|
||||||
|
MON => Monaco
|
||||||
|
NAN => Nantes
|
||||||
|
NICE => Nice
|
||||||
|
OL => Olympique Lyonnais
|
||||||
|
OM => Olympique de Marseille
|
||||||
|
PAR => Paris Saint-Germain
|
||||||
|
PSG => Paris Saint-Germain
|
||||||
|
REN => Rennes
|
||||||
|
STR => Strasbourg
|
||||||
|
|
||||||
|
Soccer - Champions League
|
||||||
|
AJA => Ajax
|
||||||
|
ASM => AS Monaco
|
||||||
|
ASS => AS Saint-Étienne
|
||||||
|
BOC => VfL Bochum
|
||||||
|
CEL => Celtic
|
||||||
|
COM => Club Brugge
|
||||||
|
FCA => FC Augsburg
|
||||||
|
FCB => Bayern Munich
|
||||||
|
FCU => FC Union Berlin
|
||||||
|
FIO => Fiorentina
|
||||||
|
GEN => Genoa
|
||||||
|
HAC => Hannover 96
|
||||||
|
IPS => Ipswich Town
|
||||||
|
KSV => Kaiserslautern
|
||||||
|
LEC => Lecce
|
||||||
|
LIL => Lille
|
||||||
|
LIV => Liverpool
|
||||||
|
M05 => Mainz 05
|
||||||
|
MCI => Manchester City
|
||||||
|
MUN => Manchester United
|
||||||
|
NAN => Nantes
|
||||||
|
OSA => Osasuna
|
||||||
|
RBL => RB Leipzig
|
||||||
|
RCL => RC Lens
|
||||||
|
RMA => Real Madrid
|
||||||
|
SCF => SC Freiburg
|
||||||
|
SGE => Eintracht Frankfurt
|
||||||
|
SR => Sporting CP
|
||||||
|
STP => St. Pauli
|
||||||
|
SVW => Werder Bremen
|
||||||
|
TFC => Toulouse FC
|
||||||
|
TOT => Tottenham Hotspur
|
||||||
|
TSG => TSG Hoffenheim
|
||||||
|
UDI => Udinese
|
||||||
|
VEN => Venezia
|
||||||
|
VFB => VfB Stuttgart
|
||||||
|
VIL => Villarreal
|
||||||
|
|
||||||
|
Soccer - Liga Portugal (Portugal)
|
||||||
|
ARO => Arouca
|
||||||
|
BEN => SL Benfica
|
||||||
|
BRA => SC Braga
|
||||||
|
CHA => Chaves
|
||||||
|
EST => Estoril Praia
|
||||||
|
FAM => Famalicão
|
||||||
|
GIL => Gil Vicente
|
||||||
|
MOR => Moreirense
|
||||||
|
POR => FC Porto
|
||||||
|
PTM => Portimonense
|
||||||
|
RIO => Rio Ave
|
||||||
|
SR => Sporting CP
|
||||||
|
VGU => Vitória de Guimarães
|
||||||
|
VSC => Vitória de Setúbal
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Soccer - Other Teams
|
||||||
|
austin => Austin FC
|
||||||
|
cf_montral => CF Montréal
|
||||||
|
charlotte => Charlotte FC
|
||||||
|
dortmund => Borussia Dortmund
|
||||||
|
gladbach => Borussia Mönchengladbach
|
||||||
|
lafc => Los Angeles FC
|
||||||
|
leverkusen => Bayer Leverkusen
|
||||||
|
nycfc => New York City FC
|
||||||
|
paris_sg => Paris Saint-Germain
|
||||||
|
st_louis => St. Louis City SC
|
||||||
|
|
||||||
MLS Conferences/Divisions
|
MLS Conferences/Divisions
|
||||||
Conferences currently unsupported
|
Conferences currently unsupported
|
||||||
|
|
||||||
|
|||||||
BIN
assets/sports/mlb_logos/mlb.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 116 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 113 KiB After Width: | Height: | Size: 74 KiB |
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 102 KiB After Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 88 KiB |
|
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 63 KiB |
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
BIN
assets/sports/ncaa_logos/AANDM.png
Normal file
|
After Width: | Height: | Size: 409 B |
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
BIN
assets/sports/ncaa_logos/AIC.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 9.6 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
BIN
assets/sports/ncaa_logos/AMH.png
Normal file
|
After Width: | Height: | Size: 27 KiB |
BIN
assets/sports/ncaa_logos/ANN.png
Normal file
|
After Width: | Height: | Size: 65 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
BIN
assets/sports/ncaa_logos/ARIZ.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
assets/sports/ncaa_logos/ARK.png
Normal file
|
After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
BIN
assets/sports/ncaa_logos/ASU.png
Normal file
|
After Width: | Height: | Size: 27 KiB |
BIN
assets/sports/ncaa_logos/AUB.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
BIN
assets/sports/ncaa_logos/BOIS.png
Normal file
|
After Width: | Height: | Size: 54 KiB |
BIN
assets/sports/ncaa_logos/BRST.png
Normal file
|
After Width: | Height: | Size: 109 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
BIN
assets/sports/ncaa_logos/BU.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
assets/sports/ncaa_logos/BUENA.png
Normal file
|
After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |