nmap_tracker: don't scan on setup (#12322)
* nmap_tracker: don't scan on setup A scan takes about 6 seconds so it delays HA from booting. Since another scan is done by the device_tracker base component during setup, there is no need to do two scans on boot. * simplify setuppull/12343/head
parent
04b68902e3
commit
d34a4fb6e3
|
@ -41,9 +41,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
|||
|
||||
def get_scanner(hass, config):
|
||||
"""Validate the configuration and return a Nmap scanner."""
|
||||
scanner = NmapDeviceScanner(config[DOMAIN])
|
||||
|
||||
return scanner if scanner.success_init else None
|
||||
return NmapDeviceScanner(config[DOMAIN])
|
||||
|
||||
|
||||
Device = namedtuple('Device', ['mac', 'name', 'ip', 'last_update'])
|
||||
|
@ -76,7 +74,6 @@ class NmapDeviceScanner(DeviceScanner):
|
|||
self._options = config[CONF_OPTIONS]
|
||||
self.home_interval = timedelta(minutes=minutes)
|
||||
|
||||
self.success_init = self._update_info()
|
||||
_LOGGER.info("Scanner initialized")
|
||||
|
||||
def scan_devices(self):
|
||||
|
|
Loading…
Reference in New Issue