Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Nicer handling of disconnects #68

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
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