mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 14:17:45 +00:00
Move imports to top for nmap_tracker (#29364)
This commit is contained in:
parent
bc635120fa
commit
564c468c26
@ -1,19 +1,20 @@
|
|||||||
"""Support for scanning a network with nmap."""
|
"""Support for scanning a network with nmap."""
|
||||||
import logging
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
import logging
|
||||||
|
|
||||||
from getmac import get_mac_address
|
from getmac import get_mac_address
|
||||||
|
from nmap import PortScanner, PortScannerError
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
import homeassistant.helpers.config_validation as cv
|
|
||||||
import homeassistant.util.dt as dt_util
|
|
||||||
from homeassistant.components.device_tracker import (
|
from homeassistant.components.device_tracker import (
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
PLATFORM_SCHEMA,
|
PLATFORM_SCHEMA,
|
||||||
DeviceScanner,
|
DeviceScanner,
|
||||||
)
|
)
|
||||||
from homeassistant.const import CONF_HOSTS
|
from homeassistant.const import CONF_HOSTS
|
||||||
|
import homeassistant.helpers.config_validation as cv
|
||||||
|
import homeassistant.util.dt as dt_util
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -91,8 +92,6 @@ class NmapDeviceScanner(DeviceScanner):
|
|||||||
"""
|
"""
|
||||||
_LOGGER.debug("Scanning...")
|
_LOGGER.debug("Scanning...")
|
||||||
|
|
||||||
from nmap import PortScanner, PortScannerError
|
|
||||||
|
|
||||||
scanner = PortScanner()
|
scanner = PortScanner()
|
||||||
|
|
||||||
options = self._options
|
options = self._options
|
||||||
|
Loading…
x
Reference in New Issue
Block a user