Skip to content

Commit

Permalink
feature: Nicer handling of disconnects
Browse files Browse the repository at this point in the history
  • Loading branch information
JJdeVries committed Mar 9, 2021
1 parent 05faa83 commit 3928953
Show file tree
Hide file tree
Showing 4 changed files with 242 additions and 142 deletions.
9 changes: 4 additions & 5 deletions aioasuswrt/asuswrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from collections import namedtuple
from datetime import datetime

from aioasuswrt.connection import SshConnection, TelnetConnection
from aioasuswrt.connection import create_connection
from aioasuswrt.helpers import convert_size

_LOGGER = logging.getLogger(__name__)
Expand Down Expand Up @@ -250,10 +250,9 @@ def __init__(
self.interface = interface
self.dnsmasq = dnsmasq

if use_telnet:
self.connection = TelnetConnection(host, port, username, password)
else:
self.connection = SshConnection(host, port, username, password, ssh_key)
self.connection = create_connection(
use_telnet, host, port, username, password, ssh_key
)

async def async_get_nvram(self, to_get):
"""Gets nvram"""
Expand Down
Loading

0 comments on commit 3928953

Please sign in to comment.