Skip to content

Commit 50ebc4a

Browse files
committed
updates for game updates
1 parent 7e54f22 commit 50ebc4a

File tree

4 files changed

+54
-3
lines changed

4 files changed

+54
-3
lines changed

config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
INTERVAL = 10
99
SCROLL = 5
1010

11-
MLB_FAVS = ['TEX', 'LAD', 'PIT']
12-
NBA_FAVS = ['DAL', 'CHI', 'POR']
11+
MLB_FAVS = ['TEX', 'PIT']
12+
NBA_FAVS = ['UTA', 'CHI', 'POR']
1313
NHL_FAVS = ['MTL', 'EDM', 'CBJ']
1414
LALIGA_FAVS = ['BAR','HUE']
1515

mlb/__init__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,23 @@ def draw_board():
135135
if games[it]['away'] != games[it]['away'] and \
136136
tmp[it]['home'] != tmp[it]['home']:
137137
it = 0
138+
elif games[it]['status'] and games[it]['score'] != tmp[it]['score']:
139+
# check for score update
140+
pos = ROWS
141+
rounds = 0
142+
while True:
143+
canvas.Clear()
144+
l = graphics.DrawText(canvas, font, pos, height_second_row, textColor, 'SCORE!!!')
145+
pos -= 1
146+
if (pos + l < 0):
147+
pos = ROWS
148+
rounds += 1
149+
if rounds > 3:
150+
break
151+
152+
time.sleep(0.05)
153+
canvas = matrix.SwapOnVSync(canvas)
154+
138155
games = tmp
139156

140157
canvas = matrix.SwapOnVSync(canvas)

nba/__init__.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,31 @@ def draw_board():
123123
# Mention to the user that they should wait after pressing the button
124124
# for about 5-10 seconds as it takes a while to fetch score
125125
wait += 1
126-
if wait > 12:
126+
if wait > 4:
127127
wait = 0
128128
tmp = Scores.get_scores()
129129

130130
# Check if new fixes
131131
if games[it]['away'] != games[it]['away'] and \
132132
tmp[it]['home'] != tmp[it]['home']:
133133
it = 0
134+
elif games[it]['status'] and games[it]['score'] != tmp[it]['score']:
135+
# check for score update
136+
pos = ROWS
137+
rounds = 0
138+
while True:
139+
canvas.Clear()
140+
l = graphics.DrawText(canvas, font, pos, height_second_row, textColor, 'SCORE!!!')
141+
pos -= 1
142+
if (pos + l < 0):
143+
pos = ROWS
144+
rounds += 1
145+
if rounds > 3:
146+
break
147+
148+
time.sleep(0.05)
149+
canvas = matrix.SwapOnVSync(canvas)
150+
134151
games = tmp
135152

136153
canvas = matrix.SwapOnVSync(canvas)

nhl/__init__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,23 @@ def draw_board():
145145
if games[it]['away'] != games[it]['away'] and \
146146
tmp[it]['home'] != tmp[it]['home']:
147147
it = 0
148+
elif games[it]['status'] and games[it]['score'] != tmp[it]['score']:
149+
# check for score update
150+
pos = ROWS
151+
rounds = 0
152+
while True:
153+
canvas.Clear()
154+
l = graphics.DrawText(canvas, font, pos, height_second_row, textColor, 'GOAL!!!')
155+
pos -= 1
156+
if (pos + l < 0):
157+
pos = ROWS
158+
rounds += 1
159+
if rounds > 3:
160+
break
161+
162+
time.sleep(0.05)
163+
canvas = matrix.SwapOnVSync(canvas)
164+
148165
games = tmp
149166

150167
canvas = matrix.SwapOnVSync(canvas)

0 commit comments

Comments
 (0)