'Set up the connection.'

def setup(self, hass, config, add_devices):

    import dovado
    self._dovado = dovado.Dovado(config.get(CONF_USERNAME), config.get(CONF_PASSWORD), config.get(CONF_HOST), config.get(CONF_PORT))
    if (not self.update()):
        return False
    def send_sms(service):
        'Send    SMS    through    the    router.'
        number = (service.data.get('number'),)
        message = service.data.get('message')
        _LOGGER.debug('message    for    %s:    %s', number, message)
        self._dovado.send_sms(number, message)
    if (self.state.get('sms') == 'enabled'):
        service_name = slugify('{}    {}'.format(self.name, 'send_sms'))
        hass.services.register(DOMAIN, service_name, send_sms)
    for sensor in SENSORS:
        if (sensor in config.get(CONF_SENSORS, [sensor])):
            add_devices([DovadoSensor(self, sensor)])
    return True
