mikemountain / fantasy-football-scoreboard

Display the score of your fantasy football team on a Raspberry Pi driven RGB LED matrix for maximum ease of disappointment
GNU General Public License v3.0
56 stars 9 forks source link

TypeError: unsupported operand type(s) for +: 'NoneType' and 'int' #9

Closed mmethot closed 3 years ago

mmethot commented 3 years ago

The script ran fine until the first kickoff of the year, but then it crashed.

Here's the log output:

INFO (21:57:57): Sleeper FF Scoreboard - v0.0.2 (64x32)
INFO (21:57:57): getting draft
INFO (21:57:59): getting teams
INFO (21:58:01): getting avatars
INFO (21:58:06): render game
INFO (21:58:06): Live State, checking every 1s
Traceback (most recent call last):
  File "main.py", line 29, in <module>
    MainRenderer(matrix, data).render()
  File "/home/pi/fantasy-football-scoreboard/renderer/main.py", line 39, in render
    self.__render_game()
  File "/home/pi/fantasy-football-scoreboard/renderer/main.py", line 67, in __render_game
    self._draw_game()
  File "/home/pi/fantasy-football-scoreboard/renderer/main.py", line 181, in _draw_game
    if matchup['user_score'] > user_score + 5 or matchup['opp_score'] > opp_score + 5:
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

I have no players playing until sunday, so I guess Sleeper return null as the matchup['user_score'] value, which probably generates the error.

mikemountain commented 3 years ago

Hey man, I'm real sorry but Sleeper's changed their API and now they don't return live player scores anymore. I'm currently looking into a work-around but it may take some time, if it works at all. I'll close this issue when I'm able to figure something out ☹️

mmethot commented 3 years ago

Oh wow, that sucks! Thanks for the heads-up anyway.

mikemountain commented 3 years ago

Should work now as of 0.0.4! Please re-open this issue if you get it happening again

mikemountain commented 3 years ago

Forgot to mention, you need to install lxml for this with apt-get install python-lxml

mmethot commented 3 years ago

Thanks for your work, Mike. Much much appreciated!