code: def close_connection(self):  # pylint: disable=C0103
          
          if self.port:
              self.stop()
              self.logger.debug("Close port '%s'" % self.comport,
                                extra={'type': '<->'})
              self.port.close()
              self.port = False
docs: Closes serial port connection.
  
          :return: Nothing