styling and version for requirement

This commit is contained in:
Tom Duijf 2015-10-07 23:22:29 +00:00
parent 7cb0f805ee
commit ae6f651c7d
3 changed files with 7 additions and 4 deletions

View File

@ -40,6 +40,7 @@ omit =
homeassistant/components/device_tracker/tomato.py
homeassistant/components/device_tracker/tplink.py
homeassistant/components/device_tracker/snmp.py
homeassistant/components/discovery.py
homeassistant/components/downloader.py
homeassistant/components/keyboard.py

View File

@ -47,7 +47,7 @@ from homeassistant.components.device_tracker import DOMAIN
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10)
_LOGGER = logging.getLogger(__name__)
REQUIREMENTS = ['pysnmp']
REQUIREMENTS = ['pysnmp<=4.2.5']
# pylint: disable=unused-argument
@ -124,10 +124,12 @@ class SnmpScanner(object):
_LOGGER.exception("SNMPLIB error: {}".format(errIndication))
return
if errStatus:
_LOGGER.exception("SNMP error: {} at {}".format(errStatus.prettyPrint(), errIndex and varBindTable[-1][int(errIndex)-1] or '?'))
_LOGGER.exception("SNMP error: {} at {}".format(
errStatus.prettyPrint(),
errIndex and varBindTable[-1][int(errIndex)-1] or '?'))
return
for varBindTableRow in varBindTable:
for _,val in varBindTableRow:
for _, val in varBindTableRow:
mac = binascii.hexlify(val.asOctets()).decode('utf-8')
mac = ':'.join([mac[i:i+2] for i in range(0, len(mac), 2)])
devices.append({'mac': mac})

View File

@ -139,5 +139,5 @@ SoCo==0.11.1
https://github.com/adrienbrault/python-plexapi/archive/df2d0847e801d6d5cda920326d693cf75f304f1a.zip#python-plexapi==1.0.2
# python-pysnmp (device_tracker.snmp)
pysnmp
pysnmp>=4.2.5