def __init__(self, config): """Initialize the scanner.""" from tplink.tplink import TpLinkClient host = config[CONF_HOST] password = config[CONF_PASSWORD] username = config[CONF_USERNAME] self.tplink_client = TpLinkClient(password, host=host, username=username) self.last_results = {} self.success_init = self._update_info()
def __init__(self, config): """Initialize the scanner.""" from tplink.tplink import TpLinkClient host = config[CONF_HOST] password = config[CONF_PASSWORD] username = config[CONF_USERNAME] self.success_init = False try: self.tplink_client = TpLinkClient(password, host=host, username=username) self.last_results = {} self.success_init = self._update_info() except requests.exceptions.RequestException: _LOGGER.debug("RequestException in %s", __class__.__name__)