add to .coveragerc and try again to fix warnings.

This commit is contained in:
Nolan Gilley 2015-08-18 17:03:13 -04:00
parent c471e39fa0
commit b84d5760eb
2 changed files with 6 additions and 2 deletions

View file

@ -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

View file

@ -49,6 +49,7 @@ _LOGGER = logging.getLogger(__name__)
_LEASES_REGEX = re.compile(r'(?P<mac>([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: