From b84d5760ebb68395fb9e1d60864530077ffc3407 Mon Sep 17 00:00:00 2001 From: Nolan Gilley Date: Tue, 18 Aug 2015 17:03:13 -0400 Subject: [PATCH] add to .coveragerc and try again to fix warnings. --- .coveragerc | 1 + homeassistant/components/device_tracker/actiontec.py | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.coveragerc b/.coveragerc index 7c0421c384a..680cd996d28 100644 --- a/.coveragerc +++ b/.coveragerc @@ -30,6 +30,7 @@ omit = homeassistant/components/browser.py homeassistant/components/camera/* + homeassistant/components/device_tracker/actiontec.py homeassistant/components/device_tracker/asuswrt.py homeassistant/components/device_tracker/ddwrt.py homeassistant/components/device_tracker/luci.py diff --git a/homeassistant/components/device_tracker/actiontec.py b/homeassistant/components/device_tracker/actiontec.py index d8d60be3ca8..ecdb0870770 100644 --- a/homeassistant/components/device_tracker/actiontec.py +++ b/homeassistant/components/device_tracker/actiontec.py @@ -49,6 +49,7 @@ _LOGGER = logging.getLogger(__name__) _LEASES_REGEX = re.compile(r'(?P([0-9a-f]{2}[:-]){5}([0-9a-f]{2}))') + # pylint: disable=unused-argument def get_scanner(hass, config): """ Validates config and returns a DD-WRT scanner. """ @@ -61,6 +62,7 @@ def get_scanner(hass, config): return scanner if scanner.success_init else None + class ActiontecDeviceScanner(object): """ This class queries a an actiontec router for connected devices. Adapted from DD-WRT scanner. @@ -119,10 +121,11 @@ class ActiontecDeviceScanner(object): telnet.write((self.username + '\n').encode('ascii')) telnet.read_until(b'Password: ') telnet.write((self.password + '\n').encode('ascii')) - prompt = telnet.read_until(b'Wireless Broadband Router> ').split(b'\n')[-1] + prompt = telnet.read_until(b'Wireless Broadband Router> ', + '').split(b'\n')[-1] telnet.write('firewall mac_cache_dump\n'.encode('ascii')) telnet.write('\n'.encode('ascii')) - _=telnet.read_until(prompt).split(b'\n')[1:-1] + telnet.read_until(prompt) leases_result = telnet.read_until(prompt).split(b'\n')[1:-1] telnet.write('exit\n'.encode('ascii')) except EOFError: