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.
133 stars 18 forks source link

Sensor is broken with HA 2024.5 #151

Open marcusboon opened 2 weeks ago

marcusboon commented 2 weeks ago

Updated HA to 2024.5 this morning and noticed that Teamtracker seems to be broken. None of the sensors provided by TeamTracker are working and the logs seem to indicate some issue

Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:356
integration: Sensor ([documentation](https://www.home-assistant.io/integrations/sensor), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+sensor%22))
First occurred: 8:13:27 AM (50 occurrences)
Last logged: 8:13:27 AM

Error while setting up teamtracker platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 356, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/config/custom_components/teamtracker/sensor.py", line 118, in async_setup_platform
    config.entry_id = slugify(f"{config.get(CONF_TEAM_ID)}")
    ^^^^^^^^^^^^^^^
AttributeError: 'NodeDictClass' object has no attribute 'entry_id'
Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:356
integration: Sensor (documentation, issues)
First occurred: 8:13:27 AM (1 occurrences)
Last logged: 8:13:27 AM

Error while setting up teamtracker platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 356, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/config/custom_components/teamtracker/sensor.py", line 115, in async_setup_platform
    config.entry_id = slugify(f"{config.get(CONF_TEAM_ID)}")
    ^^^^^^^^^^^^^^^
AttributeError: 'NodeDictClass' object has no attribute 'entry_id'
compoundbow83 commented 2 weeks ago

same here all sensores from the teams are unavailble after update HA to 2024.5.0

talsayon commented 2 weeks ago

Same issue

schumi2309 commented 2 weeks ago

you will probably have to wait for an update from Teamtracker! Patience friends...

NRutt2005 commented 1 week ago

@marcusboon @compoundbow83 @talsayon, I was having the same issue however I was able to get this issue fixed. Do you have custom sensors for this integration configured through the HA configuration file? I did have an issue with my college softball and college baseball. I deleted those sensors from my configuration file and deleted the sensor entities from the Team Tracker integration. I then restarted home assistant then re-added the these entities but thought the GUI. See the attached screenshots.

I hope this helps you out.

Screenshot 2024-05-05 at 15 55 29 Screenshot 2024-05-05 at 15 56 06
JeffCrum1 commented 1 week ago

Yeah, Mine are all 'normal' sensors. I am hoping we don't have to do this.

I expect @vasqued2 will fix this as soon as possible and we won't have to go through hoops.

For now, I'll wait for a resolution.

schumi2309 commented 1 week ago

Me too.

compoundbow83 commented 1 week ago

@marcusboon @compoundbow83 @talsayon, I was having the same issue however I was able to get this issue fixed. Do you have custom sensors for this integration configured through the HA configuration file? I did have an issue with my college softball and college baseball. I deleted those sensors from my configuration file and deleted the sensor entities from the Team Tracker integration. I then restarted home assistant then re-added the these entities but thought the GUI. See the attached screenshots.

I hope this helps you out.

Screenshot 2024-05-05 at 15 55 29 Screenshot 2024-05-05 at 15 56 06

Thank you. I does now the same way. Deleted the sensors in the config, Deleted the sensors from teamtracker. After this restart HA und add the teams over the gui. Now it works again.

vasqued2 commented 4 days ago

Sorry, haven't upgraded yet so didn't notice. I'll dig into it tomorrow.

deboy69 commented 19 hours ago

@vasqued2 any luck finding the cause of the error?

vasqued2 commented 12 hours ago

The issue was in code that was in the original nfl sensor this was based on. As such, I didn't fully understand what it was trying to do as it had always just worked. I was finally able to develop a fix that works for me and I don't believe it has any unintended side effects, which was one of my concerns without fully understanding why the original code was the way it was.

I have released it as a beta version. If you Redownload from HACS and select "Show beta versions" you should get the option to download version v0.12.0.beta. Try that.

Assuming it's stable for me today and I don't hear any issues from others, I will release it widespread tomorrow. If you try it, let me know if it works or you still have the issue.

JeffCrum1 commented 11 hours ago

Looking good for me. Thanks for fixing it.

schumi2309 commented 10 hours ago

Good for me too. Thank you. You are the best 😉

marcusboon commented 9 hours ago

+1 can confirm, the fix works for me and the sensors are back now with the v0.12.0.beta version