vasqued2 / ha-teamtracker

Home Assistant integration that provides real-time scores in multiple professional (NBA, NFL, NHL, MLB, MLS, and more), college (NCAA), and international (soccer, golf, tennis, mma, racing) sports using ESPN APIs.
159 stars 20 forks source link

Multiple Team Add? #20

Closed mermelmadness closed 1 year ago

mermelmadness commented 1 year ago

Is it possible to add multiple teams in a single configuration? For example, for NCAAM, is it possible to add an entire conference? Or would it be possible to add NFL but have every single team?

vasqued2 commented 1 year ago

Sorry, you have to set up each team’s sensor individually. Lots of copy and paste.

I know it’s horribly inefficient on the API calls so maybe someday I’ll look into making it more efficient, but it would take a major rewrite and would not be backwards compatible with the existing functionality.

mermelmadness commented 1 year ago

Ok, thanks for responding. I'm a big NCAAM fan, but I follow all 363 teams, so was hoping to utilize entities for all of them without adding them individually. Oh well. Got some long hours ahead of me, lol

vasqued2 commented 1 year ago

I’d highly discourage you from doing that. You would be much better off creating your own rest sensor that makes a single API call and then parse the results of all games than creating hundreds of separate sensors. During times of multiple games, you would have thousands of API calls going on each minute, which would not be good for you or ESPN.

See this post for details.

mermelmadness commented 1 year ago

I'll have to investigate that. I'm a novice when it comes to JSON construction and RESTful calls. And being able to parse it in a way that HA will understand. Tall order. Thanks for the advice.