From 78826648e3056110a230a86df830f639eb44bd0c Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Mon, 31 Aug 2015 00:44:59 -0700 Subject: [PATCH] style + dependency fix --- homeassistant/components/device_tracker/nmap_tracker.py | 8 ++++---- requirements_all.txt | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/device_tracker/nmap_tracker.py b/homeassistant/components/device_tracker/nmap_tracker.py index 31f60bf032b..8724f3a196a 100644 --- a/homeassistant/components/device_tracker/nmap_tracker.py +++ b/homeassistant/components/device_tracker/nmap_tracker.py @@ -132,17 +132,17 @@ class NmapDeviceScanner(object): now = dt_util.now() self.last_results = [] - for ip, info in result['scan'].items(): + for ipv4, info in result['scan'].items(): if info['status']['state'] != 'up': 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 = info['addresses'].get('mac') if mac is None: - mac = _arp(ip) + mac = _arp(ipv4) if mac is None: continue - device = Device(mac.upper(), name, ip, now) + device = Device(mac.upper(), name, ipv4, now) self.last_results.append(device) self.last_results.extend(exclude_targets) diff --git a/requirements_all.txt b/requirements_all.txt index 9798a95f030..92a80edbb72 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -25,7 +25,7 @@ pyuserinput==0.1.9 tellcore-py==1.0.4 # Nmap bindings (device_tracker.nmap) -python-libnmap==0.6.3 +python-nmap==0.4.1 # PushBullet bindings (notify.pushbullet) pushbullet.py==0.7.1