'Retrieve data from ASUSWRT and return parsed result.'

def get_asuswrt_data(self):

    result = self.connection.get_result()
    if (not result):
        return {}
    devices = {}
    if (self.mode == 'ap'):
        for lease in result.leases:
            match = _WL_REGEX.search(lease.decode('utf-8'))
            if (not match):
                _LOGGER.warning('Could    not    parse    wl    row:    %s', lease)
                continue
            host = ''
            devices[match.group('mac').upper()] = {'host': host, 'status': 'IN_ASSOCLIST', 'ip': '', 'mac': match.group('mac').upper()}
    else:
        for lease in result.leases:
            if lease.startswith('duid    '):
                continue
            match = _LEASES_REGEX.search(lease.decode('utf-8'))
            if (not match):
                _LOGGER.warning('Could    not    parse    lease    row:    %s', lease)
                continue
            host = match.group('host')
            if (host == '*'):
                host = ''
            devices[match.group('mac')] = {'host': host, 'status': '', 'ip': match.group('ip'), 'mac': match.group('mac').upper()}
        for neighbor in result.neighbors:
            match = _IP_NEIGH_REGEX.search(neighbor.decode('utf-8'))
            if (not match):
                _LOGGER.warning('Could    not    parse    neighbor    row:    %s', neighbor)
                continue
            if (match.group('mac') in devices):
                devices[match.group('mac')]['status'] = match.group('status')
    return devices
