mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 16:57:10 +00:00
Add support for multiple inputs to nmap tracking module as a list (#3944)
This commit is contained in:
parent
081e61528d
commit
d60c2d604f
@ -30,7 +30,7 @@ CONF_EXCLUDE = 'exclude'
|
||||
REQUIREMENTS = ['python-nmap==0.6.1']
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||
vol.Required(CONF_HOSTS): cv.string,
|
||||
vol.Required(CONF_HOSTS): cv.ensure_list,
|
||||
vol.Required(CONF_HOME_INTERVAL, default=0): cv.positive_int,
|
||||
vol.Optional(CONF_EXCLUDE, default=[]):
|
||||
vol.All(cv.ensure_list, vol.Length(min=1))
|
||||
@ -120,7 +120,8 @@ class NmapDeviceScanner(object):
|
||||
options += ' --exclude {}'.format(','.join(exclude_hosts))
|
||||
|
||||
try:
|
||||
result = scanner.scan(hosts=self.hosts, arguments=options)
|
||||
result = scanner.scan(hosts=' '.join(self.hosts),
|
||||
arguments=options)
|
||||
except PortScannerError:
|
||||
return False
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user