mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-07-08 16:34:28 +02:00
removed library check since it is now included in the integration #2
This commit is contained in:
parent
b70bb9db92
commit
4f8c709488
3 changed files with 10 additions and 33 deletions
|
@ -25,7 +25,6 @@ from .const import (
|
|||
DEFAULT_SCAN_INTERVAL,
|
||||
)
|
||||
|
||||
from .exceptions import OldLibrouteros
|
||||
from .mikrotikapi import MikrotikAPI
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
@ -73,18 +72,14 @@ class MikrotikControllerConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
errors["base"] = "name_exists"
|
||||
|
||||
# Test connection
|
||||
try:
|
||||
api = MikrotikAPI(host=user_input["host"],
|
||||
username=user_input["username"],
|
||||
password=user_input["password"],
|
||||
port=user_input["port"],
|
||||
use_ssl=user_input["ssl"]
|
||||
)
|
||||
except OldLibrouteros:
|
||||
errors["base"] = "librouteros_invalid"
|
||||
else:
|
||||
if not api.connect():
|
||||
errors[CONF_HOST] = api.error
|
||||
api = MikrotikAPI(host=user_input["host"],
|
||||
username=user_input["username"],
|
||||
password=user_input["password"],
|
||||
port=user_input["port"],
|
||||
use_ssl=user_input["ssl"]
|
||||
)
|
||||
if not api.connect():
|
||||
errors[CONF_HOST] = api.error
|
||||
|
||||
# Save instance
|
||||
if not errors:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue