diff --git a/espn_api/football/league.py b/espn_api/football/league.py index b4abf564..a07a8166 100644 --- a/espn_api/football/league.py +++ b/espn_api/football/league.py @@ -185,9 +185,9 @@ def scoreboard(self, week: int = None) -> List[Matchup]: for team in self.teams: for matchup in matchups: - if matchup.home_team == team.team_id: + if matchup._home_team_id == team.team_id: matchup.home_team = team - elif matchup.away_team == team.team_id: + elif matchup._away_team_id == team.team_id: matchup.away_team = team return matchups diff --git a/espn_api/football/matchup.py b/espn_api/football/matchup.py index cbc397cd..b5fa5262 100644 --- a/espn_api/football/matchup.py +++ b/espn_api/football/matchup.py @@ -1,10 +1,14 @@ +from .team import Team + class Matchup(object): '''Creates Matchup instance''' def __init__(self, data): self.matchup_type = data.get('playoffTierType', 'NONE') self.is_playoff = self.matchup_type != 'NONE' - (self.home_team, self.home_score) = self._fetch_matchup_info(data, 'home') - (self.away_team, self.away_score) = self._fetch_matchup_info(data, 'away') + (self._home_team_id, self.home_score) = self._fetch_matchup_info(data, 'home') + (self._away_team_id, self.away_score) = self._fetch_matchup_info(data, 'away') + self.home_team: Team + self.away_team: Team def __repr__(self): return f'Matchup({self.home_team}, {self.away_team})'