mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Always pad mac addresses from nmap tracker with leading zeros (#23492)
This commit is contained in:
parent
75a2c057f2
commit
09012e7baa
@ -47,7 +47,7 @@ def _arp(ip_address):
|
|||||||
out, _ = arp.communicate()
|
out, _ = arp.communicate()
|
||||||
match = re.search(r'(([0-9A-Fa-f]{1,2}\:){5}[0-9A-Fa-f]{1,2})', str(out))
|
match = re.search(r'(([0-9A-Fa-f]{1,2}\:){5}[0-9A-Fa-f]{1,2})', str(out))
|
||||||
if match:
|
if match:
|
||||||
return match.group(0)
|
return ':'.join([i.zfill(2) for i in match.group(0).split(':')])
|
||||||
_LOGGER.info('No MAC address found for %s', ip_address)
|
_LOGGER.info('No MAC address found for %s', ip_address)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user