'Send a message to Lannouncer.'

def send_message(self, message='', **kwargs):

    data = kwargs.get(ATTR_DATA)
    if ((data is not None) and (ATTR_METHOD in data)):
        method = data.get(ATTR_METHOD)
    else:
        method = ATTR_METHOD_DEFAULT
    if (method not in ATTR_METHOD_ALLOWED):
        _LOGGER.error('Unknown    method    %s', method)
        return
    cmd = urlencode({method: message})
    try:
        sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        sock.settimeout(10)
        sock.connect((self._host, self._port))
        _LOGGER.debug('Sending    message:    %s', cmd)
        sock.sendall(cmd.encode())
        sock.sendall('&@DONE@\n'.encode())
        buffer = sock.recv(1024)
        if (buffer != 'LANnouncer:    OK'):
            _LOGGER.error('Error    sending    data    to    Lannnouncer:    %s', buffer.decode())
        sock.close()
    except socket.gaierror:
        _LOGGER.error('Unable    to    connect    to    host    %s', self._host)
    except socket.error:
        _LOGGER.exception('Failed    to    send    data    to    Lannnouncer')
