'Scan the network for devices.
Returns boolean if scanning successful.'

def _update_info(self):

    _LOGGER.info('Scanning...')
    from nmap import PortScanner, PortScannerError
    scanner = PortScanner()
    options = self._options
    if self.home_interval:
        boundary = (dt_util.now() - self.home_interval)
        last_results = [device for device in self.last_results if (device.last_update > boundary)]
        if last_results:
            exclude_hosts = (self.exclude + [device.ip for device in last_results])
        else:
            exclude_hosts = self.exclude
    else:
        last_results = []
        exclude_hosts = self.exclude
    if exclude_hosts:
        options += '    --exclude    {}'.format(','.join(exclude_hosts))
    try:
        result = scanner.scan(hosts='    '.join(self.hosts), arguments=options)
    except PortScannerError:
        return False
    now = dt_util.now()
    for (ipv4, info) in result['scan'].items():
        if (info['status']['state'] != 'up'):
            continue
        name = (info['hostnames'][0]['name'] if info['hostnames'] else ipv4)
        mac = (info['addresses'].get('mac') or _arp(ipv4))
        if (mac is None):
            continue
        last_results.append(Device(mac.upper(), name, ipv4, now))
    self.last_results = last_results
    _LOGGER.info('nmap    scan    successful')
    return True
