Include doctrings and reorder imports
This commit is contained in:
@@ -1,10 +1,13 @@
|
|||||||
|
"""Home Assistant Fpl integration Config Flow"""
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
from .fplapi import FplApi
|
|
||||||
|
|
||||||
from homeassistant import config_entries
|
from homeassistant import config_entries
|
||||||
from homeassistant.helpers.aiohttp_client import async_create_clientsession
|
from homeassistant.helpers.aiohttp_client import async_create_clientsession
|
||||||
|
from homeassistant.core import callback
|
||||||
|
|
||||||
|
from .fplapi import FplApi
|
||||||
|
|
||||||
from .const import DOMAIN, CONF_USERNAME, CONF_PASSWORD, CONF_NAME
|
from .const import DOMAIN, CONF_USERNAME, CONF_PASSWORD, CONF_NAME
|
||||||
|
|
||||||
@@ -14,8 +17,6 @@ from .fplapi import (
|
|||||||
LOGIN_RESULT_INVALIDPASSWORD,
|
LOGIN_RESULT_INVALIDPASSWORD,
|
||||||
)
|
)
|
||||||
|
|
||||||
from homeassistant.core import callback
|
|
||||||
|
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def configured_instances(hass):
|
def configured_instances(hass):
|
||||||
@@ -27,6 +28,7 @@ def configured_instances(hass):
|
|||||||
|
|
||||||
|
|
||||||
class FplFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
class FplFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
|
"""Fpl Config Flow Handler"""
|
||||||
|
|
||||||
VERSION = 1
|
VERSION = 1
|
||||||
CONNECTION_CLASS = config_entries.CONN_CLASS_CLOUD_POLL
|
CONNECTION_CLASS = config_entries.CONN_CLASS_CLOUD_POLL
|
||||||
@@ -70,7 +72,7 @@ class FplFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
if result == LOGIN_RESULT_INVALIDPASSWORD:
|
if result == LOGIN_RESULT_INVALIDPASSWORD:
|
||||||
self._errors[CONF_PASSWORD] = "invalid_password"
|
self._errors[CONF_PASSWORD] = "invalid_password"
|
||||||
|
|
||||||
if result == None:
|
if result is None:
|
||||||
self._errors["base"] = "auth"
|
self._errors["base"] = "auth"
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user