Python 3.8.2 -Try to find chromecast in local Network-PyChromecast

Viewed 289

I tried to find my chromecast over the python-module Pychromecast, but I couldn't find any chromecast in my local network. This is my code:

import pychromecast

services, browser = pychromecast.discovery.discover_chromecasts()
pychromecast.discovery.stop_discovery(browser)
chromecasts, browser = pychromecast.get_listed_chromecasts(friendly_names=["MY-CAST"])

Then i tried it with the IP and it worked, but when I try to search it and print out the value chromecast, I get this:

[]

My OS: Windows 10 x64
I reinstalled the module and reconnected to the network

1 Answers

After 'stop_discovery' loop through 'services' and print them. My guess is the friendly name isn't "MY-CAST" and you'll be able to see what it actually is from the service details.

Related