daviswieck / ha-college-football

5 stars 1 forks source link

Incorrect team pull? #7

Open rjbrown99 opened 5 months ago

rjbrown99 commented 5 months ago

I recognize we are in the offseason so perhaps that's all that is happening here. But when I put the correct 3 letter team name in (let's say PSU in my case), it's pulling game attribute data for Louisville-Austin Peay. Is that what I would expect to see at this time of year? ESPN does have the 1st game data in there.

I'm testing some automations now, hence the question. Thank you.

daviswieck commented 5 months ago

Ah yes.. been meaning to get around to that... for a temporary fix, you can go to file editor -> custom components -> college_football -> const.py And change the api endpoint. Change the group number in the endpoint from 80 to whichever conference you want.

daviswieck commented 5 months ago

Penn State / Big10 would be group number 5

rjbrown99 commented 5 months ago

Thank you. In my case the endpoint was already set to 80.

API_ENDPOINT = "https://site.api.espn.com/apis/site/v2/sports/football/college-football/scoreboard?groups=80&limit=150"

Still shows Louisville.

Not sure if you have seen/used the College Football Data API: https://api.collegefootballdata.com/api/docs/?url=/api-docs.json

They aggregate info from all sorts of places (including ESPN) and normalize it into a rather robust dataset. Might be another option if the direct ESPN data is somewhat unreliable.

daviswieck commented 5 months ago

Correct. Group 80 will pull every game. If you change it to group=05. It will just pull Big10 games only. It's a quirk in the code... in this case, it found "PSU" in "APSU" so it pulled its information instead because it was first in the list.

I'll take a look at it and see if I can fix it.

I'll take a look at the other one also!

rjbrown99 commented 5 months ago

Perfect thank you, that did resolve it (and now also know why it happened, thanks for that as well.)