Skip to content

Commit

Permalink
Fix for games in warmup status
Browse files Browse the repository at this point in the history
  • Loading branch information
ty-porter committed Jul 15, 2023
1 parent 6487899 commit 6200091
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
14 changes: 9 additions & 5 deletions data/config/layout.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from driver import graphics

import os.path
import debug

FONTNAME_DEFAULT = "4x6"
FONTNAME_KEY = "font_name"
Expand Down Expand Up @@ -36,14 +37,17 @@ def font(self, keypath):

def coords(self, keypath):
try:
d = self.__find_at_keypath(keypath)
coord_dict = self.__find_at_keypath(keypath)
except KeyError as e:
raise e

if self.state in AVAILABLE_OPTIONAL_KEYS:
if self.state in d:
return d[self.state]
return d
if not isinstance(coord_dict, dict) or not self.state in AVAILABLE_OPTIONAL_KEYS:
return coord_dict

if self.state in coord_dict:
return coord_dict[self.state]

return coord_dict

def set_state(self, new_state=None):
if new_state in AVAILABLE_OPTIONAL_KEYS:
Expand Down
2 changes: 1 addition & 1 deletion renderers/games/teams.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def __render_team_text(canvas, layout, colors, team, homeaway, full_team_names,
def __render_record_text(canvas, layout, colors, team, homeaway, default_colors):
if "losses" not in team.record or "wins" not in team.record:
return
if not layout.coords("teams.record.enabled"):
if not layout.coords("teams.record").get("enabled", False):
return

text_color = colors.get("text", default_colors["text"])
Expand Down
2 changes: 1 addition & 1 deletion version.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SCRIPT_NAME = "MLB LED Scoreboard"
SCRIPT_VERSION = "6.4.0"
SCRIPT_VERSION = "6.4.1"


if __name__ == "__main__":
Expand Down

0 comments on commit 6200091

Please sign in to comment.