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

View File

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