1
0
mirror of https://github.com/home-assistant/core.git synced 2026-02-28 13:56:28 +00:00

Fix typo an coding style (#13970)

This commit is contained in:
stephanerosi
2018-04-18 12:43:55 +02:00
committed by Pascal Vizeli
parent 4ba58d0760
commit f11d4319d2

View File

@@ -94,13 +94,11 @@ class NmapDeviceScanner(DeviceScanner):
return None
def get_extra_attributes(self, device):
"""Return the IP pf the given device."""
filter_ip = [result.ip for result in self.last_results
if result.mac == device]
if filter_ip:
return {'ip': filter_ip[0]}
return None
"""Return the IP of the given device."""
filter_ip = next((
result.ip for result in self.last_results
if result.mac == device), None)
return {'ip': filter_ip}
def _update_info(self):
"""Scan the network for devices.