Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
arim215 committed Nov 6, 2018
1 parent 880ee5f commit 376568e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions lib/light.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import random
import platform
import pygame
Expand All @@ -24,7 +23,7 @@ def setup():

def activate_goal_light(gpio_event_var=0):
""" Function to activate GPIO for goal light and plar random audio clip. """
songrandom = random.randint(1, 3) #Set random numbers depending on number of audio clips available
songrandom = random.randint(3, 3) #Set random numbers depending on number of audio clips available
# Prepare commande to play sound (change file name if needed)
pygame.mixer.init()
pygame.mixer.music.load('/home/pi/nhl_goal_light/audio/goal_horn_{SongId}.mp3'.format(SongId=str(songrandom)))
Expand Down
3 changes: 1 addition & 2 deletions lib/nhl.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def fetch_score(team_id):

def check_season():
""" Function to check if in season. Returns True if in season, False in off season. """

# Get current time
now = datetime.datetime.now()
if now.month in (7, 8):
Expand All @@ -71,7 +72,6 @@ def check_season():
def check_if_game(team_id):
""" Function to check if there is a game now with chosen team. Returns True if game, False if NO game. """


# Set URL depending on team selected
url = '{0}schedule?teamId={1}'.format(NHL_API_URL, team_id) #Only shows games after noon, so will sleep till 12:10 pm
try:
Expand All @@ -85,7 +85,6 @@ def check_if_game(team_id):
print("Error encountered, returning True for check_game")
return True


def check_game_end(team_id):
""" Function to check if the game ofchosen team is over. Returns True if game, False if NO game. """

Expand Down

0 comments on commit 376568e

Please sign in to comment.