'Send Join notifications.'

def notify(self, title, message, config):

    notification = {u'title': title, u'text': message, u'url': config.get(u'url'), u'icon': config.get(u'icon'), u'priority': config.get(u'priority'), u'apikey': config[u'api_key']}
    if config.get(u'device'):
        if isinstance(config[u'device'], list):
            notification[u'deviceIds'] = u','.join(config[u'device'])
        else:
            notification[u'deviceId'] = config[u'device']
    elif config.get(u'group'):
        notification[u'deviceId'] = (u'group.' + config[u'group'])
    else:
        notification[u'deviceId'] = u'group.all'
    if config.get(u'device_name'):
        if isinstance(config[u'device_name'], list):
            notification[u'deviceNames'] = u','.join(config[u'device_name'])
        else:
            notification[u'deviceNames'] = config[u'device_name']
    if config.get(u'sms_number'):
        notification[u'smsnumber'] = config[u'sms_number']
        notification[u'smstext'] = message
    try:
        response = requests.get(JOIN_URL, params=notification)
    except RequestException as e:
        raise PluginWarning(e.args[0])
    else:
        error = response.json().get(u'errorMessage')
        if error:
            raise PluginWarning(error)
