mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 10:17:09 +00:00
style + dependency fix
This commit is contained in:
parent
ffac067be8
commit
78826648e3
@ -132,17 +132,17 @@ class NmapDeviceScanner(object):
|
|||||||
|
|
||||||
now = dt_util.now()
|
now = dt_util.now()
|
||||||
self.last_results = []
|
self.last_results = []
|
||||||
for ip, info in result['scan'].items():
|
for ipv4, info in result['scan'].items():
|
||||||
if info['status']['state'] != 'up':
|
if info['status']['state'] != 'up':
|
||||||
continue
|
continue
|
||||||
name = info['hostnames'][0] if info['hostnames'] else ip
|
name = info['hostnames'][0] if info['hostnames'] else ipv4
|
||||||
# Mac address only returned if nmap ran as root
|
# Mac address only returned if nmap ran as root
|
||||||
mac = info['addresses'].get('mac')
|
mac = info['addresses'].get('mac')
|
||||||
if mac is None:
|
if mac is None:
|
||||||
mac = _arp(ip)
|
mac = _arp(ipv4)
|
||||||
if mac is None:
|
if mac is None:
|
||||||
continue
|
continue
|
||||||
device = Device(mac.upper(), name, ip, now)
|
device = Device(mac.upper(), name, ipv4, now)
|
||||||
self.last_results.append(device)
|
self.last_results.append(device)
|
||||||
self.last_results.extend(exclude_targets)
|
self.last_results.extend(exclude_targets)
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ pyuserinput==0.1.9
|
|||||||
tellcore-py==1.0.4
|
tellcore-py==1.0.4
|
||||||
|
|
||||||
# Nmap bindings (device_tracker.nmap)
|
# Nmap bindings (device_tracker.nmap)
|
||||||
python-libnmap==0.6.3
|
python-nmap==0.4.1
|
||||||
|
|
||||||
# PushBullet bindings (notify.pushbullet)
|
# PushBullet bindings (notify.pushbullet)
|
||||||
pushbullet.py==0.7.1
|
pushbullet.py==0.7.1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user