removed library check since it is now included in the integration #2

This commit is contained in:
tomaae 2019-12-08 09:09:31 +01:00
parent b70bb9db92
commit 4f8c709488
3 changed files with 10 additions and 33 deletions

View file

@ -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: