def setup_platform(hass, config, add_devices_callback, discovery_info=None):
    from pyW215.pyW215 import SmartPlug

    # check for required values in configuration file
    if not validate_config({DOMAIN: config},
                           {DOMAIN: [CONF_HOST]},
                           _LOGGER):
        return False

    host = config.get(CONF_HOST)
    username = config.get(CONF_USERNAME, DEFAULT_USERNAME)
    password = str(config.get(CONF_PASSWORD, DEFAULT_PASSWORD))
    name = config.get(CONF_NAME, DEVICE_DEFAULT_NAME)

    add_devices_callback([SmartPlugSwitch(SmartPlug(host,
                                                    password,
                                                    username),
                                          name)])
Find and return D-Link Smart Plugs.
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/switch/dlink.py/setup_platform