mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Fix typo an coding style (#13970)
This commit is contained in:
parent
4ba58d0760
commit
f11d4319d2
@ -94,13 +94,11 @@ class NmapDeviceScanner(DeviceScanner):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def get_extra_attributes(self, device):
|
def get_extra_attributes(self, device):
|
||||||
"""Return the IP pf the given device."""
|
"""Return the IP of the given device."""
|
||||||
filter_ip = [result.ip for result in self.last_results
|
filter_ip = next((
|
||||||
if result.mac == device]
|
result.ip for result in self.last_results
|
||||||
|
if result.mac == device), None)
|
||||||
if filter_ip:
|
return {'ip': filter_ip}
|
||||||
return {'ip': filter_ip[0]}
|
|
||||||
return None
|
|
||||||
|
|
||||||
def _update_info(self):
|
def _update_info(self):
|
||||||
"""Scan the network for devices.
|
"""Scan the network for devices.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user