'Retrieve data from Actiontec MI424WR and return parsed result.'

def get_actiontec_data(self):

    try:
        telnet = telnetlib.Telnet(self.host)
        telnet.read_until('Username:    ')
        telnet.write((self.username + '\n').encode('ascii'))
        telnet.read_until('Password:    ')
        telnet.write((self.password + '\n').encode('ascii'))
        prompt = telnet.read_until('Wireless    Broadband    Router>    ').split('\n')[(-1)]
        telnet.write('firewall    mac_cache_dump\n'.encode('ascii'))
        telnet.write('\n'.encode('ascii'))
        telnet.read_until(prompt)
        leases_result = telnet.read_until(prompt).split('\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.    Telnet    enabled?')
        return None
    devices = {}
    for lease in leases_result:
        match = _LEASES_REGEX.search(lease.decode('utf-8'))
        if (match is not None):
            devices[match.group('ip')] = {'ip': match.group('ip'), 'mac': match.group('mac').upper(), 'timevalid': int(match.group('timevalid'))}
    return devices
