home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
74.13k stars 31.12k forks source link

Pandora integration has blocking call to sleep inside the event loop #122027

Open brmccrary opened 4 months ago

brmccrary commented 4 months ago

The problem

When trying to turn on the Pandora integration's provided media player, I get the following which causes the integration to completely fail:

Failed to call service media_player/toggle. Caught blocking call to sleep with args (0.05,) inside the event loop by integration 'pandora' at homeassistant/components/pandora/media_player.py, line 204: self._pianobar.send("i"). (offender: /home/homeassistant/homeassistant/lib/python3.12/site-packages/pexpect/pty_spawn.py, line 540: time.sleep(self.delaybeforesend)), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+pandora%22 For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#sleep

I have wrote a couple small integrations that had the same problem with 2024.7 and was able to fix them by putting the affected routines in a thread. I possibly could try to submit a PR for this integration, as it appears dead based on past issues that have never been addressed, but I'm a very amateur programmer and not sure it would be up to the standards to be allowed into the main core. Maybe it would at least get us started though. Hopefully someone maintains this integration that knows more about it than I do.

What version of Home Assistant Core has the issue?

2024.7

What was the last working version of Home Assistant Core?

2024.6

What type of installation are you running?

Home Assistant Core

Integration causing the issue

Pandora

Link to integration documentation on our website

https://www.home-assistant.io/integrations/pandora

Diagnostics information

This is due to PR https://github.com/home-assistant/core/pull/118561

Example YAML snippet

No response

Anything in the logs that might be useful for us?

This is due to PR <https://github.com/home-assistant/core/pull/118561>

Additional information

No response

home-assistant[bot] commented 4 months ago

pandora documentation pandora source

hpolished commented 2 months ago

Stuck on Home Assistant Core 2024.6.4 because of this exact same issue. Anybody know if this is ever getting fixed? Not a coder so I can't fix it myself. Are there any workarounds or alternatives? Any help much appreciated!

Thanks!