test specific game monitoring
This commit is contained in:
@@ -311,6 +311,14 @@ def draw_all_games(canvas, games, start_index):
|
|||||||
for row in range(32):
|
for row in range(32):
|
||||||
canvas.SetPixel(offset + 63, row, 40, 40, 40)
|
canvas.SetPixel(offset + 63, row, 40, 40, 40)
|
||||||
|
|
||||||
|
def draw_single_game(canvas, game):
|
||||||
|
league = game["league"]
|
||||||
|
home_logo = load_logo(league, game["home"])
|
||||||
|
away_logo = load_logo(league, game["away"])
|
||||||
|
|
||||||
|
draw_logo(canvas, away_logo, 0, 0)
|
||||||
|
draw_logo(canvas, home_logo, 0, 16)
|
||||||
|
|
||||||
|
|
||||||
# --- Main loop ---
|
# --- Main loop ---
|
||||||
def run():
|
def run():
|
||||||
@@ -324,9 +332,24 @@ def run():
|
|||||||
last_switch = time()
|
last_switch = time()
|
||||||
|
|
||||||
current_games = get_all_scores()
|
current_games = get_all_scores()
|
||||||
|
preferred_team = [
|
||||||
|
"BUF",
|
||||||
|
"TOR",
|
||||||
|
"TB"
|
||||||
|
]
|
||||||
|
preferred_game = []
|
||||||
for game in current_games:
|
for game in current_games:
|
||||||
print(game)
|
print(game)
|
||||||
|
if game['home'] in preferred_team or game['away'] in preferred_team:
|
||||||
|
if game['status'] != 'Final':
|
||||||
|
preferred_game_on = True
|
||||||
|
preferred_game.append(game)
|
||||||
|
|
||||||
|
if preferred_game_on:
|
||||||
|
while True:
|
||||||
|
draw_single_game(canvas, preferred_game[0])
|
||||||
|
sleep(0.03)
|
||||||
|
else:
|
||||||
while True:
|
while True:
|
||||||
now = time()
|
now = time()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user