code: def init(self):
          '''
          Initialize serial device.
          Parameters of serial.Serial: http://pyserial.sourceforge.net/pyserial_api.html
          Plus termination string parameter eol
          '''
          super(Serial, self).init()
          self.read_termination = self._init.get('read_termination', None)
          self.write_termination = self._init.get('write_termination', self.read_termination)
          try:
              self.read_termination = bytes(self.read_termination, 'utf-8')
              self.write_termination = bytes(self.write_termination, 'utf-8')
          except TypeError as e:
              logger.debug(e)
          self.timeout = self._init.get('timeout', None)  # timeout of 0 returns immediately
  
          self._port = serial.Serial(**{key: value for key, value in self._init.items() if key not in ("read_termination", "write_termination")}f init(self):
          '''
          Initialize serial device.
          Parameters of serial.Serial: http://pyserial.sourceforge.net/pyserial_api.html
          Plus termination string parameter eol
          '''
          super(Serial, self).init()
          self.read_termination = self._init.get('read_termination', None)
          self.write_termination = self._init.get('write_termination', self.read_termination)
          try:
              self.read_termination = bytes(self.read_termination, 'utf-8')
              self.write_termination = bytes(self.write_termination, 'utf-8')
          except TypeError as e:
              logger.debug(e)
          self.timeout = self._init.get('timeout', None)  # timeout of 0 returns immediately
  
          self._port = serial.Serial(**{key: value for key, value in self._init.items() if key not in ("read_termination", "write_termination")})
docs: Initialize serial device.
          Parameters of serial.Serial: http://pyserial.sourceforge.net/pyserial_api.html
          Plus termination string parameter eol