pychromecast icon indicating copy to clipboard operation
pychromecast copied to clipboard

Dicovery thread using pychromecast.get_chromecasts stops working after some some time

Open gallmerci opened this issue 4 years ago • 2 comments

I am running a thread that needs to discover the available chromecasts by calling

available_casts = pychromecast.get_chromecasts(tries=1, retry_wait=1, timeout=1)

every 10 seconds. It works fine for a while but at some point the returned list is always empty and I can only restart the program to make it work again. I already got the hint to use CastListener for this use case but still think this might be an issue :) Any ideas what the problem could be?

gallmerci avatar May 25 '20 22:05 gallmerci

That's not a good way of doing things, please do like this instead: https://github.com/home-assistant-libs/pychromecast/blob/master/examples/discovery_example.py

Anyhow, there may be an issue with pychromecast.get_chromecasts. What OS are you running?

emontnemery avatar May 25 '20 22:05 emontnemery

Thanks, I start testing with the start_discovery function. I am running it on a raspberry pi using linux.

gallmerci avatar May 26 '20 00:05 gallmerci