mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
change logging to debug for nmap (#22036)
This commit is contained in:
parent
2b25c25ca8
commit
b022428cb6
@ -1,14 +1,9 @@
|
|||||||
"""
|
"""Support for scanning a network with nmap."""
|
||||||
Support for scanning a network with nmap.
|
|
||||||
|
|
||||||
For more details about this platform, please refer to the documentation at
|
|
||||||
https://home-assistant.io/components/device_tracker.nmap_tracker/
|
|
||||||
"""
|
|
||||||
from datetime import timedelta
|
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
from datetime import timedelta
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
@ -74,7 +69,7 @@ class NmapDeviceScanner(DeviceScanner):
|
|||||||
self._options = config[CONF_OPTIONS]
|
self._options = config[CONF_OPTIONS]
|
||||||
self.home_interval = timedelta(minutes=minutes)
|
self.home_interval = timedelta(minutes=minutes)
|
||||||
|
|
||||||
_LOGGER.info("Scanner initialized")
|
_LOGGER.debug("Scanner initialized")
|
||||||
|
|
||||||
def scan_devices(self):
|
def scan_devices(self):
|
||||||
"""Scan for new devices and return a list with found device IDs."""
|
"""Scan for new devices and return a list with found device IDs."""
|
||||||
@ -105,7 +100,7 @@ class NmapDeviceScanner(DeviceScanner):
|
|||||||
|
|
||||||
Returns boolean if scanning successful.
|
Returns boolean if scanning successful.
|
||||||
"""
|
"""
|
||||||
_LOGGER.info("Scanning...")
|
_LOGGER.debug("Scanning...")
|
||||||
|
|
||||||
from nmap import PortScanner, PortScannerError
|
from nmap import PortScanner, PortScannerError
|
||||||
scanner = PortScanner()
|
scanner = PortScanner()
|
||||||
@ -146,5 +141,5 @@ class NmapDeviceScanner(DeviceScanner):
|
|||||||
|
|
||||||
self.last_results = last_results
|
self.last_results = last_results
|
||||||
|
|
||||||
_LOGGER.info("nmap scan successful")
|
_LOGGER.debug("nmap scan successful")
|
||||||
return True
|
return True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user