diff --git a/homeassistant/components/device_tracker/snmp.py b/homeassistant/components/device_tracker/snmp.py index f6df3f0a509..9981b4d7ca6 100644 --- a/homeassistant/components/device_tracker/snmp.py +++ b/homeassistant/components/device_tracker/snmp.py @@ -18,7 +18,7 @@ from homeassistant.util import Throttle MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10) _LOGGER = logging.getLogger(__name__) -REQUIREMENTS = ['pysnmp==4.2.5'] +REQUIREMENTS = ['pysnmp==4.3.2'] CONF_COMMUNITY = "community" CONF_BASEOID = "baseoid" @@ -72,7 +72,7 @@ class SnmpScanner(object): @Throttle(MIN_TIME_BETWEEN_SCANS) def _update_info(self): - """Ensure the information from the WAP is up to date. + """Ensure the information from the device is up to date. Return boolean if scanning successful. """ @@ -88,7 +88,7 @@ class SnmpScanner(object): return True def get_snmp_data(self): - """Fetch MAC addresses from WAP via SNMP.""" + """Fetch MAC addresses from access point via SNMP.""" devices = [] errindication, errstatus, errindex, restable = self.snmp.nextCmd( @@ -97,9 +97,10 @@ class SnmpScanner(object): if errindication: _LOGGER.error("SNMPLIB error: %s", errindication) return + # pylint: disable=no-member if errstatus: _LOGGER.error('SNMP error: %s at %s', errstatus.prettyPrint(), - errindex and restable[-1][int(errindex)-1] or '?') + errindex and restable[int(errindex) - 1][0] or '?') return for resrow in restable: diff --git a/requirements_all.txt b/requirements_all.txt index ccd4ac83970..6decd570696 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -262,7 +262,7 @@ pyowm==2.3.1 pyserial<=3.0 # homeassistant.components.device_tracker.snmp -pysnmp==4.2.5 +pysnmp==4.3.2 # homeassistant.components.sensor.forecast python-forecastio==1.3.4