'Build up connection and set event delegator and service.'

def _connect(self):

    if (not self._nuimo):
        return
    try:
        self._nuimo.connect()
        _LOGGER.debug('Connected    to    %s', self._mac)
    except RuntimeError as error:
        _LOGGER.error('Could    not    connect    to    %s:    %s', self._mac, error)
        time.sleep(1)
        return
    nuimo_event_delegate = NuimoLogger(self._hass, self._name)
    self._nuimo.set_delegate(nuimo_event_delegate)
    def handle_write_matrix(call):
        'Handle    led    matrix    service.'
        matrix = call.data.get('matrix', None)
        name = call.data.get(CONF_NAME, DEFAULT_NAME)
        interval = call.data.get('interval', DEFAULT_INTERVAL)
        if ((self._name == name) and matrix):
            self._nuimo.write_matrix(matrix, interval)
    self._hass.services.register(DOMAIN, SERVICE_NUIMO, handle_write_matrix, schema=SERVICE_NUIMO_SCHEMA)
    self._nuimo.write_matrix(HOMEASSIST_LOGO, 2.0)
