Skip to content

Commit

Permalink
Merge branch 'master' into spike/bullpen
Browse files Browse the repository at this point in the history
  • Loading branch information
ty-porter committed Mar 8, 2024
2 parents 7e5da2d + c5bf3cb commit 8d13e94
Show file tree
Hide file tree
Showing 32 changed files with 420 additions and 121 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/require_release_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,13 @@ jobs:
run: |
echo "ERROR: You can only merge to master from dev. Contributors should point their PRs to the dev branch."
exit 1
- uses: actions/checkout@v3
if: github.base_ref == 'master'
with:
fetch-depth: 0

- name: Check version.py
if: github.base_ref == 'master'
run: |
git diff --name-only origin/master | grep -q version.py || (echo "Need to change version for pushes to master!" && exit 1)
4 changes: 2 additions & 2 deletions .github/workflows/run_unittest_on_pr_open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -25,4 +25,4 @@ jobs:
pip install -r ./requirements.txt
- name: Test with unittest
run: |
python -m unittest discover -s ./tests -p 'test_*.py'
python -m unittest discover -s ./tests -p 'test_*.py'
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# mlb-led-scoreboard

![Current Version](https://img.shields.io/github/v/release/MLB-LED-Scoreboard/MLB-LED-Scoreboard) [![Join Discord](https://img.shields.io/badge/discord-join-blue.svg)](https://discord.gg/FdD6ec9fdt)
[![Join Slack](https://img.shields.io/badge/slack-join%20(deprecated)-blue.svg)](https://join.slack.com/t/mlb-led-scoreboard/shared_invite/zt-1f6n4axo4-r32OH7dlSAjEjstFV4RDNQ)


<a href="assets/img/header.jpg">
<img alt="Project header" width="800px" height="auto" src="assets/img/header.jpg">
Expand Down Expand Up @@ -41,7 +41,7 @@ If you'd like to see support for another set of board dimensions, or have design
* [Custom Colors](#custom-colors)
* [Sources](#sources)
* [Accuracy Disclaimer](#accuracy-disclaimer)
* [Wiki](#wiki)
* [Wiki](https://github.com/MLB-LED-Scoreboard/mlb-led-scoreboard/wiki)
* [Help and Contributing](#help-and-contributing)
* [Latest Features](#latest-features)
* [Licensing](#licensing)
Expand Down Expand Up @@ -259,7 +259,10 @@ A default `config.json.example` file is included for reference. Copy this file t
### Additional Features
* Runs/Hits/Errors - Runs are always shown on the games screen, but you can enable or adjust spacing of a "runs, hits, errors" display. Take a look at the [coordinates readme file](/coordinates/README.md) for details.

* Pitch Data - Pitch data can be shown on the game screen, See the [coordinates readme file](/coordinates/README.md) for details. In addition, the Short and Long pitch description can be changed in data/pitches.py
* Pitch Data - Pitch data can be shown on the game screen, See the [coordinates readme file](/coordinates/README.md) for details. In addition, the `short` and `long` pitch description can be changed in data/pitches.py

* Previous Play Data - Data for the previous play can be shown on the game screen. See the [coordinates readme file](/coordinates/README.md) for details. Long and short play descriptions can be changed in data/plays.py
* **NOTE:** Because play result data is ephemeral, not every play result will be displayed. Situations like a mound visit, injury, or other timeout immediately following a play often cause the play result to be immediately replaced on the MLB API.

### Flags

Expand Down
Binary file added assets/mlb-w128h32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion colors/scoreboard.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,15 @@
"g": 255,
"b": 255
},
"strikeout": {
"play_result": {
"r": 255,
"g": 235,
"b": 59
},
"strikeout": {
"r": 255,
"g": 0,
"b": 0
}
},
"batter_count": {
Expand Down
6 changes: 5 additions & 1 deletion coordinates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ The layout can have a couple of different states where things are rendered diffe
## Pitch Data
* `enabled` (true/false) turn feature on/off
* `mph` (true/false) When rendering pitch speed add mph after (99 mph)
* `desc_length` (Short/Long) The short or long pitch type description, you can change both the short and long description to your liking in data/pitches as long as you do not change the index value.
* `desc_length` (short/long) The short or long pitch type description, you can change both the short and long description to your liking in data/pitches as long as you do not change the index value.

## Play Result
* `enabled` (true/false) turn feature on/off
* `desc_length` (short/long) The short or long play result description. You can change both the short and long description to your liking in data/plays.

## Updates
The software develops and releases features with full support for the default layouts, so custom layouts may look unsatisfactory if you update to later versions of the scoreboard. If you as a user decide to create a custom layout file, you are responsible for tweaking the coordinates to your liking with each update.
Expand Down
27 changes: 24 additions & 3 deletions coordinates/w128h32.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
"y": 50,
"enabled": false,
"mph": false,
"desc_length": "Short"
"desc_length": "short"
},
"pitch_count": {
"font_name": "4x6",
Expand All @@ -184,8 +184,16 @@
},
"loop": 64,
"strikeout": {
"x": 84,
"y": 30
"x": 60,
"y": 30,
"desc_length": "short",
"enabled": true
},
"play_result": {
"x": 60,
"y": 30,
"desc_length": "short",
"enabled": true
}
},
"pregame": {
Expand Down Expand Up @@ -291,6 +299,19 @@
"y": 10
}
},
"record": {
"enabled": false,
"away": {
"font_name": "4x6",
"x": 19,
"y": 7
},
"home": {
"font_name": "4x6",
"x": 19,
"y": 17
}
},
"runs": {
"runs_hits_errors": {
"show": false,
Expand Down
25 changes: 22 additions & 3 deletions coordinates/w128h64.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
"y": 50,
"enabled": true,
"mph": true,
"desc_length": "Long"
"desc_length": "long"
},
"pitch_count": {
"font_name": "4x6",
Expand All @@ -146,8 +146,16 @@
},
"loop": 68,
"strikeout": {
"x": 32,
"y": 60
"x": 16,
"y": 60,
"desc_length": "long",
"enabled": true
},
"play_result": {
"x": 16,
"y": 60,
"desc_length": "long",
"enabled": true
}
},
"batter_count": {
Expand Down Expand Up @@ -271,6 +279,17 @@
"y": 29
}
},
"record": {
"enabled": false,
"away": {
"x": 30,
"y": 13
},
"home": {
"x": 30,
"y": 29
}
},
"runs": {
"runs_hits_errors": {
"show": true,
Expand Down
25 changes: 22 additions & 3 deletions coordinates/w192h64.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
"y": 50,
"enabled": true,
"mph": true,
"desc_length": "Long"
"desc_length": "long"
},
"pitch_count": {
"font_name": "4x6",
Expand All @@ -146,8 +146,16 @@
},
"loop": 68,
"strikeout": {
"x": 32,
"y": 60
"x": 16,
"y": 60,
"desc_length": "long",
"enabled": true
},
"play_result": {
"x": 16,
"y": 60,
"desc_length": "long",
"enabled": true
}
},
"batter_count": {
Expand Down Expand Up @@ -271,6 +279,17 @@
"y": 29
}
},
"record": {
"enabled": false,
"away": {
"x": 30,
"y": 13
},
"home": {
"x": 30,
"y": 29
}
},
"runs": {
"runs_hits_errors": {
"show": true,
Expand Down
23 changes: 21 additions & 2 deletions coordinates/w32h32.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
"y": 50,
"enabled": false,
"mph": false,
"desc_length": "Short"
"desc_length": "short"
},
"pitch_count": {
"font_name": "4x6",
Expand All @@ -165,7 +165,15 @@
"loop": 16,
"strikeout": {
"x": 33,
"y": 33
"y": 33,
"desc_length": "short",
"enabled": false
},
"play_result": {
"x": 33,
"y": 33,
"desc_length": "short",
"enabled": false
}
},
"batter_count": {
Expand Down Expand Up @@ -278,6 +286,17 @@
"y": 13
}
},
"record": {
"enabled": false,
"away": {
"x": 4,
"y": 6
},
"home": {
"x": 4,
"y": 13
}
},
"runs": {
"runs_hits_errors": {
"show": false,
Expand Down
25 changes: 23 additions & 2 deletions coordinates/w64h32.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
"y": 50,
"enabled": false,
"mph": false,
"desc_length": "Short"
"desc_length": "short"
},
"pitch_count": {
"x": 1,
Expand All @@ -142,8 +142,18 @@
"strikeout": {
"x": 15,
"y": 29,
"font_name": "5x7"
"font_name": "5x7",
"desc_length": "short",
"enabled": true
},
"play_result": {
"x": 15,
"y": 29,
"font_name": "5x7",
"desc_length": "short",
"enabled": true
}

},
"batter_count": {
"x": 34,
Expand Down Expand Up @@ -263,6 +273,17 @@
"y": 7
}
},
"record": {
"enabled": false,
"away": {
"x": 15,
"y": 6
},
"home": {
"x": 15,
"y": 13
}
},
"runs": {
"runs_hits_errors": {
"show": true,
Expand Down
25 changes: 23 additions & 2 deletions coordinates/w64h64.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
"y": 50,
"enabled": false,
"mph": false,
"desc_length": "Short"
"desc_length": "short"
},
"pitch_count": {
"font_name": "4x6",
Expand All @@ -141,7 +141,15 @@
"loop": 64,
"strikeout": {
"x": 31,
"y": 36
"y": 36,
"desc_length": "short",
"enabled": true
},
"play_result": {
"x": 31,
"y": 36,
"desc_length": "short",
"enabled": true
}
},
"pregame": {
Expand Down Expand Up @@ -247,6 +255,19 @@
"y": 10
}
},
"record": {
"enabled": false,
"away": {
"font_name": "4x6",
"x": 18,
"y": 7
},
"home": {
"font_name": "4x6",
"x": 18,
"y": 17
}
},
"runs": {
"runs_hits_errors": {
"show": false,
Expand Down
5 changes: 3 additions & 2 deletions data/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from data import status
from data.config.color import Color
from data.config.layout import Layout
from data.time_formats import TIME_FORMAT_12H, TIME_FORMAT_24H
from utils import deep_update

SCROLLING_SPEEDS = [0.3, 0.2, 0.1, 0.075, 0.05, 0.025, 0.01]
Expand Down Expand Up @@ -136,9 +137,9 @@ def check_preferred_divisions(self):

def check_time_format(self):
if self.time_format.lower() == "24h":
self.time_format = "%H"
self.time_format = TIME_FORMAT_24H
else:
self.time_format = "%I"
self.time_format = TIME_FORMAT_12H

def check_rotate_rates(self):
if not isinstance(self.rotation_rates, dict):
Expand Down
Loading

0 comments on commit 8d13e94

Please sign in to comment.