def __init__(self, config):
        """Initialize the scanner."""
        self.last_results = []
        self.host = '169.254.1.1'  # This IP is valid for all FRITZ!Box router.
        self.username = 'admin'
        self.password = ''
        self.success_init = True

        # pylint: disable=import-error
        import fritzconnection as fc

        # Check for user specific configuration
        if CONF_HOST in config.keys():
            self.host = config[CONF_HOST]
        if config.keys() in CONF_USERNAME:
            self.username = config[CONF_USERNAME]
        if CONF_PASSWORD in config.keys():
            self.password = config[CONF_PASSWORD]

        # Establish a connection to the FRITZ!Box.
        try:
            self.fritz_box = fc.FritzHosts(address=self.host,
                                           user=self.username,
                                           password=self.password)
        except (ValueError, TypeError):
            self.fritz_box = None

        # At this point it is difficult to tell if a connection is established.
        # So just check for null objects.
        if self.fritz_box is None or not self.fritz_box.modelname:
            self.success_init = False

        if self.success_init:
            _LOGGER.info("Successfully connected to %s",
                         self.fritz_box.modelname)
            self._update_info()
        else:
            _LOGGER.error("Failed to establish connection to FRITZ!Box "
                          "with IP: %s", self.host)
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/device_tracker/fritz.py/FritzBoxScanner.__init__/swapped operands of `in`