device_tracker.asuswrt: Clean up unused connection param (#12262)

This commit is contained in:
Albert Lee 2018-02-09 17:21:10 -06:00 committed by Paulus Schoutsen
parent 7c36c5d9b4
commit 1db4df6d3a
2 changed files with 6 additions and 9 deletions

View File

@ -118,11 +118,10 @@ class AsusWrtDeviceScanner(DeviceScanner):
if self.protocol == 'ssh':
self.connection = SshConnection(
self.host, self.port, self.username, self.password,
self.ssh_key, self.mode == 'ap')
self.ssh_key)
else:
self.connection = TelnetConnection(
self.host, self.port, self.username, self.password,
self.mode == 'ap')
self.host, self.port, self.username, self.password)
self.last_results = {}
@ -253,7 +252,7 @@ class _Connection:
class SshConnection(_Connection):
"""Maintains an SSH connection to an ASUS-WRT router."""
def __init__(self, host, port, username, password, ssh_key, ap):
def __init__(self, host, port, username, password, ssh_key):
"""Initialize the SSH connection properties."""
super().__init__()
@ -263,7 +262,6 @@ class SshConnection(_Connection):
self._username = username
self._password = password
self._ssh_key = ssh_key
self._ap = ap
def run_command(self, command):
"""Run commands through an SSH connection.
@ -323,7 +321,7 @@ class SshConnection(_Connection):
class TelnetConnection(_Connection):
"""Maintains a Telnet connection to an ASUS-WRT router."""
def __init__(self, host, port, username, password, ap):
def __init__(self, host, port, username, password):
"""Initialize the Telnet connection properties."""
super().__init__()
@ -332,7 +330,6 @@ class TelnetConnection(_Connection):
self._port = port
self._username = username
self._password = password
self._ap = ap
self._prompt_string = None
def run_command(self, command):

View File

@ -473,7 +473,7 @@ class TestSshConnection(unittest.TestCase):
def setUp(self):
"""Setup test env."""
self.connection = SshConnection(
'fake', 'fake', 'fake', 'fake', 'fake', 'fake')
'fake', 'fake', 'fake', 'fake', 'fake')
self.connection._connected = True
def test_run_command_exception_eof(self):
@ -513,7 +513,7 @@ class TestTelnetConnection(unittest.TestCase):
def setUp(self):
"""Setup test env."""
self.connection = TelnetConnection(
'fake', 'fake', 'fake', 'fake', 'fake')
'fake', 'fake', 'fake', 'fake')
self.connection._connected = True
def test_run_command_exception_eof(self):