'Send a command to the pa server using a socket.'

def _send_command(self, cmd, response_expected):

    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    sock.settimeout(self._tcp_timeout)
    try:
        sock.connect((self._pa_host, self._pa_port))
        _LOGGER.info('Calling    pulseaudio:    %s', cmd)
        sock.send((cmd + '\n').encode('utf-8'))
        if response_expected:
            return_data = self._get_full_response(sock)
            _LOGGER.debug('Data    received    from    pulseaudio:    %s', return_data)
        else:
            return_data = ''
    finally:
        sock.close()
    return return_data
