Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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