Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async def connect(self):
- """ Connect to an Android TV device.
- Will attempt to establish ADB connection to the given host.
- Failure sets state to UNKNOWN and disables sending actions.
- """
- try:
- if self.adbkey:
- self._adb = AsyncADBConnection(self.host, self.adbkey)
- else:
- self._adb = AsyncADBConnection(self.host)
- if not self.package_launcher:
- with self._adb:
- await self._adb.command(self.home())
- self.package_launcher = await self._adb.command(self.current_app)
- except socket_error as serr:
- logging.warning("Couldn't connect to host: %s, error: %s", self.host, serr.strerror)
Advertisement
Add Comment
Please, Sign In to add comment