def setup(hass, config):
    'Set up the Smapee component.'
    client_id = config.get(DOMAIN).get(CONF_CLIENT_ID)
    client_secret = config.get(DOMAIN).get(CONF_CLIENT_SECRET)
    username = config.get(DOMAIN).get(CONF_USERNAME)
    password = config.get(DOMAIN).get(CONF_PASSWORD)
    host = config.get(DOMAIN).get(CONF_HOST)
    host_password = config.get(DOMAIN).get(CONF_HOST_PASSWORD)
    smappee = Smappee(client_id, client_secret, username, password, host, host_password)
    if ((not smappee.is_local_active) and (not smappee.is_remote_active)):
        _LOGGER.error('Neither Smappee server or local component enabled.')
        return False
    hass.data[DATA_SMAPPEE] = smappee
    load_platform(hass, 'switch', DOMAIN)
    load_platform(hass, 'sensor', DOMAIN)
    return True
Set up the Smapee component.
def setup(hass, config):
    
    client_id = config.get(DOMAIN).get(CONF_CLIENT_ID)
    client_secret = config.get(DOMAIN).get(CONF_CLIENT_SECRET)
    username = config.get(DOMAIN).get(CONF_USERNAME)
    password = config.get(DOMAIN).get(CONF_PASSWORD)
    host = config.get(DOMAIN).get(CONF_HOST)
    host_password = config.get(DOMAIN).get(CONF_HOST_PASSWORD)
    smappee = Smappee(client_id, client_secret, username, password, host, host_password)
    if ((not smappee.is_local_active) and (not smappee.is_remote_active)):
        _LOGGER.error('Neither Smappee server or local component enabled.')
        return False
    hass.data[DATA_SMAPPEE] = smappee
    load_platform(hass, 'switch', DOMAIN)
    load_platform(hass, 'sensor', DOMAIN)
    return True