Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions homeassistant/components/device_tracker/asuswrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,10 @@ def __init__(self, config):
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 = {}

Expand Down Expand Up @@ -253,7 +252,7 @@ def disconnect(self):
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__()

Expand All @@ -263,7 +262,6 @@ def __init__(self, host, port, username, password, ssh_key, ap):
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.
Expand Down Expand Up @@ -323,7 +321,7 @@ def disconnect(self): \
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__()

Expand All @@ -332,7 +330,6 @@ def __init__(self, host, port, username, password, ap):
self._port = port
self._username = username
self._password = password
self._ap = ap
self._prompt_string = None

def run_command(self, command):
Expand Down
4 changes: 2 additions & 2 deletions tests/components/device_tracker/test_asuswrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down