home-assistant-libs / pychromecast

Library for Python 3 to communicate with the Google Chromecast.
MIT License
2.54k stars 379 forks source link

Is it possible to start a DashCast app (casting an URL, no audio/video) in parallel to e.g. tuneIn? #354

Closed Acer54 closed 4 years ago

Acer54 commented 4 years ago

I am trying to get my home-automation showed up on my Google-Hub and managed it with this code:

assert isinstance(cast, pychromecast.Chromecast) # cast was set... cast.wait()

cast.quit_app() # does not change behaviour if active or not...

cast.dashcast = dashcast.DashCastController() dc = cast.dashcast cast.register_handler(dc) dc.load_url("http://192.168.178.30:8082/vis/myhome.html", force=True) time.sleep(5) cast.disconnect()

The downside at the moment is, that every time when I execute the code above my playing audio-stream (e.g. tuneIn or Spotify) is stopped due to the start of DashCast ... Is there a way to tell DashCast NOT to act like an Audio/Video Source but as just a (silent) url like wikipedia would show up, even when music is playing...

Any suggestions?

Thanks in advance, Matthias

balloob commented 4 years ago

That's not possible. Both Music and DashCast are Cast Apps and only 1 can be running at a time.