def get_asuswrt_data(self):
        """Retrieve data from ASUSWRT and return parsed result."""
        try:
            telnet = telnetlib.Telnet(self.host)
            telnet.read_until(b'login: ')
            telnet.write((self.username + '\n').encode('ascii'))
            telnet.read_until(b'Password: ')
            telnet.write((self.password + '\n').encode('ascii'))
            prompt_string = telnet.read_until(b'#').split(b'\n')[-1]
            telnet.write('ip neigh\n'.encode('ascii'))
            neighbors = telnet.read_until(prompt_string).split(b'\n')[1:-1]
            telnet.write('cat /var/lib/misc/dnsmasq.leases\n'.encode('ascii'))
            leases_result = telnet.read_until(prompt_string).split(b'\n')[1:-1]
            telnet.write('exit\n'.encode('ascii'))
        except EOFError:
            _LOGGER.exception("Unexpected response from router")
            return
        except ConnectionRefusedError:
            _LOGGER.exception("Connection refused by router," +
                              " is telnet enabled?")
            return

        devices = {}
        for lease in leases_result:
            match = _LEASES_REGEX.search(lease.decode('utf-8'))

            if not match:
                _LOGGER.warning("Could not parse lease row: %s", lease)
                continue

            # For leases where the client doesn't set a hostname, ensure it is
            # blank and not '*', which breaks the entity_id down the line.
            host = match.group('host')
            if host == '*':
                host = ''

            devices[match.group('ip')] = {
                'host': host,
                'status': '',
                'ip': match.group('ip'),
                'mac': match.group('mac').upper(),
                }

        for neighbor in neighbors:
            match = _IP_NEIGH_REGEX.search(neighbor.decode('utf-8'))
            if not match:
                _LOGGER.warning("Could not parse neighbor row: %s", neighbor)
                continue
            if devices in match.group('ip'):
                devices[match.group('ip')]['status'] = match.group('status')
        return devices
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/device_tracker/asuswrt.py/AsusWrtDeviceScanner.get_asuswrt_data/swapped operands of `in`