From c58184b0f760a77d018d674f5dacfa2a80ac420f Mon Sep 17 00:00:00 2001 From: tomaae <23486452+tomaae@users.noreply.github.com> Date: Sat, 7 Dec 2019 23:37:48 +0100 Subject: [PATCH] changed config_entries import added connection class --- custom_components/mikrotik_router/config_flow.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/custom_components/mikrotik_router/config_flow.py b/custom_components/mikrotik_router/config_flow.py index ae91a3f..ba8c4cf 100644 --- a/custom_components/mikrotik_router/config_flow.py +++ b/custom_components/mikrotik_router/config_flow.py @@ -2,8 +2,12 @@ import logging import voluptuous as vol -from homeassistant import config_entries from homeassistant.core import callback +from homeassistant.config_entries import ( + CONN_CLASS_LOCAL_POLL, + ConfigFlow, + OptionsFlow, +) from homeassistant.const import ( CONF_NAME, CONF_HOST, @@ -40,8 +44,12 @@ def configured_instances(hass): # --------------------------- # MikrotikControllerConfigFlow # --------------------------- -class MikrotikControllerConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): +class MikrotikControllerConfigFlow(ConfigFlow, domain=DOMAIN): """MikrotikControllerConfigFlow class""" + + VERSION = 1 + CONNECTION_CLASS = CONN_CLASS_LOCAL_POLL + def __init__(self): """Initialize MikrotikControllerConfigFlow.""" return @@ -118,7 +126,7 @@ class MikrotikControllerConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): # --------------------------- # MikrotikControllerOptionsFlowHandler # --------------------------- -class MikrotikControllerOptionsFlowHandler(config_entries.OptionsFlow): +class MikrotikControllerOptionsFlowHandler(OptionsFlow): """Handle options.""" def __init__(self, config_entry):