code: def _write_to_device_and_return(cmd, ack, device_connection):
      '''Writes to a serial device.
      - Formats command
      - Wait for ack return
      - return parsed response'''
      log.debug('Write -> {}'.format(cmd.encode()))
      device_connection.write(cmd.encode())
      response = device_connection.read_until(ack.encode())
      log.debug('Read <- {}'.format(response))
      if ack.encode() not in response:
          raise SerialNoResponse(
              'No response from serial port after {} second(s)'.format(
                  device_connection.timeout))
      clean_response = _parse_serial_response(response, ack.encode())
      if clean_response:
          return clean_response.decode()
      return 'f _write_to_device_and_return(cmd, ack, device_connection):
      '''Writes to a serial device.
      - Formats command
      - Wait for ack return
      - return parsed response'''
      log.debug('Write -> {}'.format(cmd.encode()))
      device_connection.write(cmd.encode())
      response = device_connection.read_until(ack.encode())
      log.debug('Read <- {}'.format(response))
      if ack.encode() not in response:
          raise SerialNoResponse(
              'No response from serial port after {} second(s)'.format(
                  device_connection.timeout))
      clean_response = _parse_serial_response(response, ack.encode())
      if clean_response:
          return clean_response.decode()
      return ''
docs: Writes to a serial device.
      - Formats command
      - Wait for ack return
      - return parsed response