mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Make get_snmp_data more robust (#6798)
This commit is contained in:
parent
be04ef7be1
commit
a70af62e60
@ -125,7 +125,10 @@ class SnmpScanner(DeviceScanner):
|
||||
|
||||
for resrow in restable:
|
||||
for _, val in resrow:
|
||||
mac = binascii.hexlify(val.asOctets()).decode('utf-8')
|
||||
try:
|
||||
mac = binascii.hexlify(val.asOctets()).decode('utf-8')
|
||||
except AttributeError:
|
||||
continue
|
||||
_LOGGER.debug("Found MAC %s", mac)
|
||||
mac = ':'.join([mac[i:i+2] for i in range(0, len(mac), 2)])
|
||||
devices.append({'mac': mac})
|
||||
|
Loading…
x
Reference in New Issue
Block a user