How to use the catt.controllers.get_chromecast_with_ip function in catt

To help you get started, we’ve selected a few catt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github skorokithakis / catt / catt / api.py View on Github external
def _create_cast(self) -> None:
        self._cast = get_chromecast_with_ip(self.ip_addr) if self.ip_addr else get_chromecast(self.name)
        if not self._cast:
            raise CastError("Device could not be found")
        self._cast.wait()

        self.name = self._cast.name
        self.ip_addr = self._cast.host
        self.uuid = self._cast.uuid