code: async def scan_for_apple_tvs(loop, timeout=5, abort_on_found=False,
                               device_ip=None, only_usable=True,
                               protocol=None):
      
      semaphore = asyncio.Semaphore(value=0, loop=loop)
      listener = _ServiceListener(
          loop, abort_on_found, device_ip, protocol, semaphore)
      zeroconf = Zeroconf()
      try:
          ServiceBrowser(zeroconf, HOMESHARING_SERVICE, listener)
          ServiceBrowser(zeroconf, DEVICE_SERVICE, listener)
          ServiceBrowser(zeroconf, MEDIAREMOTE_SERVICE, listener)
          ServiceBrowser(zeroconf, AIRPLAY_SERVICE, listener)
          _LOGGER.debug('Discovering devices for %d seconds', timeout)
          await asyncio.wait_for(semaphore.acquire(), timeout, loop=loop)
      except concurrent.futures.TimeoutError:
          pass  # Will happen when timeout occurs (totally normal)
      finally:
          zeroconf.close()
  
      def _should_include(atv):
          if not only_usable:
              return True
  
          return atv.is_usable()
  
      return list(filter(_should_include, listener.found_devices.values()))
docs: Scan for Apple TVs using zeroconf (bonjour) and returns them.