def close(self): if self._com is not None: log.info("Closing connection to: %s", self.dev) self._com.close()