diff --git a/chromecast_mpris/base.py b/chromecast_mpris/base.py index 6707a0b..07f83f8 100644 --- a/chromecast_mpris/base.py +++ b/chromecast_mpris/base.py @@ -24,7 +24,11 @@ def get_chromecast(name: str) -> Optional[pychromecast.Chromecast]: chromecasts = pychromecast.get_chromecasts() if not name: - return chromecasts[0] if chromecasts else None + if chromecasts: + chromecasts[0].wait() + return chromecasts[0] + else: + return None name = name.lower()