pychromecast
pychromecast copied to clipboard
Dicovery thread using pychromecast.get_chromecasts stops working after some some time
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?
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?
Thanks, I start testing with the start_discovery function. I am running it on a raspberry pi using linux.