code: def data_received(self, data):
          
          # DIY line buffering...
          newline = b'\r\n'
          eot = b'\x04'
          self._readbuf += data
          while newline in self._readbuf:
              line, _, self._readbuf = self._readbuf.partition(newline)
              if line:
                  if eot in line:
                      # Discard everything before EOT
                      _, _, line = line.partition(eot)
                  try:
                      decoded = line.decode('ascii')
                  except UnicodeDecodeError:
                      _LOGGER.debug("Invalid data received, ignoring...")
                      return
                  self.line_received(decoded)
docs: Gets called when new data is received on the serial interface.
          Perform line buffering and call line_received() with complete
          lines.