MLB-LED-Scoreboard / mlb-led-scoreboard

An LED scoreboard for Major League Baseball :baseball:
GNU General Public License v3.0
582 stars 105 forks source link

Issue when trying to set Dbacks as preferred team #473

Closed stsmith313 closed 1 year ago

stsmith313 commented 1 year ago

This issue is a

Hardware Configuration

Software Configuration

Expected behavior

Dbacks should be shown as preferred team.

Actual behavior

There is a keyerror that happens when trying to run the program instead. If I am using the wrong team name I apologize. I was unable to find the correct team name documented anywhere.

Additional Information

ERROR (09:15:09): Untrapped error in main! Traceback (most recent call last): File "/home/sam/mlb-led-scoreboard/main.py", line 168, in main(matrix, config) File "/home/sam/mlb-led-scoreboard/main.py", line 70, in main data = Data(config) File "/home/sam/mlb-led-scoreboard/data/init.py", line 25, in init self.current_game: Game = self.schedule.get_preferred_game() File "/home/sam/mlb-led-scoreboard/data/schedule.py", line 93, in get_preferred_game team_index = self._game_index_for_preferred_team() File "/home/sam/mlb-led-scoreboard/data/schedule.py", line 131, in _game_index_for_preferred_team team_name = data.teams.TEAM_FULL[self.config.preferred_teams[0]] KeyError: 'Dbacks'

WardBrian commented 1 year ago

Try the name D-backs

stsmith313 commented 1 year ago

Try the name D-backs

Yea I've tried every iteration you can think of and same issue. Done the same thing with Arizona as well.

WardBrian commented 1 year ago

The error you originally posted is coming from this file, which uses D-backs. Does the error change if you use that name?

https://github.com/MLB-LED-Scoreboard/mlb-led-scoreboard/blob/a593d537c7ea84bc4bfbd09ff572f52724980131/data/teams.py#L26

stsmith313 commented 1 year ago

Looks like the error does change.

ERROR (10:05:45): Untrapped error in main! Traceback (most recent call last): File "/home/sam/mlb-led-scoreboard/main.py", line 168, in main(matrix, config) File "/home/sam/mlb-led-scoreboard/main.py", line 70, in main data = Data(config) File "/home/sam/mlb-led-scoreboard/data/init.py", line 37, in init self.headlines: Headlines = Headlines(config, self.schedule.date.year) File "/home/sam/mlb-led-scoreboard/data/headlines.py", line 106, in init self.compile_feed_list() File "/home/sam/mlb-led-scoreboard/data/headlines.py", line 183, in compile_feed_list self.feed_urls.append(self.__mlb_url_for_team(team)) File "/home/sam/mlb-led-scoreboard/data/headlines.py", line 191, in __mlb_url_for_team return "{}/{}/{}".format(MLB_BASE, MLB_FEEDS[team_name], MLB_PATH) KeyError: 'D-backs'

ty-porter commented 1 year ago

What version of the scoreboard is this running? To output:

sudo python3 version.py
ty-porter commented 1 year ago

It looks like the headline keys mismatch:

https://github.com/MLB-LED-Scoreboard/mlb-led-scoreboard/blob/a593d537c7ea84bc4bfbd09ff572f52724980131/data/headlines.py#L42

stsmith313 commented 1 year ago

What version of the scoreboard is this running? To output:

sudo python3 version.py

v6.3.1

I did see the keys mismatched but didn't know if that was intentional or not based on their API

ty-porter commented 1 year ago

@stsmith313 this should be fixed on the dev branch, if you want to try it out we can release it

git checkout dev

Then run it, if it works for you we can go ahead and cut the actual release

stsmith313 commented 1 year ago

@ty-porter Yes! That worked. Thanks so much for everyone's help!