

def setup_platform(hass, config, add_devices_callback, discovery_info=None):
    'Find and return D-Link Smart Plugs.'
    from pyW215.pyW215 import SmartPlug
    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)])

dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/switch/dlink.py setup_platform/original