mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 14:17:45 +00:00
Clean last usages of old config flow handlers decorator (#64329)
This commit is contained in:
parent
8bcf495caf
commit
a0bbe46c4a
@ -11,12 +11,12 @@ from pyalmond import AlmondLocalAuth, WebAlmondAPI
|
|||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
from yarl import URL
|
from yarl import URL
|
||||||
|
|
||||||
from homeassistant import config_entries, core, data_entry_flow
|
from homeassistant import core, data_entry_flow
|
||||||
from homeassistant.components.hassio import HassioServiceInfo
|
from homeassistant.components.hassio import HassioServiceInfo
|
||||||
from homeassistant.data_entry_flow import FlowResult
|
from homeassistant.data_entry_flow import FlowResult
|
||||||
from homeassistant.helpers import aiohttp_client, config_entry_oauth2_flow
|
from homeassistant.helpers import aiohttp_client, config_entry_oauth2_flow
|
||||||
|
|
||||||
from .const import DOMAIN as ALMOND_DOMAIN, TYPE_LOCAL, TYPE_OAUTH2
|
from .const import DOMAIN, TYPE_LOCAL, TYPE_OAUTH2
|
||||||
|
|
||||||
|
|
||||||
async def async_verify_local_connection(hass: core.HomeAssistant, host: str):
|
async def async_verify_local_connection(hass: core.HomeAssistant, host: str):
|
||||||
@ -33,11 +33,12 @@ async def async_verify_local_connection(hass: core.HomeAssistant, host: str):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
@config_entries.HANDLERS.register(ALMOND_DOMAIN)
|
class AlmondFlowHandler(
|
||||||
class AlmondFlowHandler(config_entry_oauth2_flow.AbstractOAuth2FlowHandler):
|
config_entry_oauth2_flow.AbstractOAuth2FlowHandler, domain=DOMAIN
|
||||||
|
):
|
||||||
"""Implementation of the Almond OAuth2 config flow."""
|
"""Implementation of the Almond OAuth2 config flow."""
|
||||||
|
|
||||||
DOMAIN = ALMOND_DOMAIN
|
DOMAIN = DOMAIN
|
||||||
|
|
||||||
host = None
|
host = None
|
||||||
hassio_discovery = None
|
hassio_discovery = None
|
||||||
|
@ -7,12 +7,7 @@ import voluptuous as vol
|
|||||||
from homeassistant import config_entries
|
from homeassistant import config_entries
|
||||||
from homeassistant.const import CONF_EMAIL, CONF_PASSWORD
|
from homeassistant.const import CONF_EMAIL, CONF_PASSWORD
|
||||||
|
|
||||||
from .const import (
|
from .const import CONF_2FA, CONF_AUTH_CODE, CONF_REFRESH_TOKEN, DOMAIN
|
||||||
CONF_2FA,
|
|
||||||
CONF_AUTH_CODE,
|
|
||||||
CONF_REFRESH_TOKEN,
|
|
||||||
DOMAIN as HANGOUTS_DOMAIN,
|
|
||||||
)
|
|
||||||
from .hangups_utils import (
|
from .hangups_utils import (
|
||||||
Google2FAError,
|
Google2FAError,
|
||||||
GoogleAuthError,
|
GoogleAuthError,
|
||||||
@ -21,8 +16,7 @@ from .hangups_utils import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@config_entries.HANDLERS.register(HANGOUTS_DOMAIN)
|
class HangoutsFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
class HangoutsFlowHandler(config_entries.ConfigFlow):
|
|
||||||
"""Config flow Google Hangouts."""
|
"""Config flow Google Hangouts."""
|
||||||
|
|
||||||
VERSION = 1
|
VERSION = 1
|
||||||
|
@ -6,19 +6,11 @@ import voluptuous as vol
|
|||||||
from homeassistant import config_entries
|
from homeassistant import config_entries
|
||||||
from homeassistant.data_entry_flow import FlowResult
|
from homeassistant.data_entry_flow import FlowResult
|
||||||
|
|
||||||
from .const import (
|
from .const import _LOGGER, DOMAIN, HMIPC_AUTHTOKEN, HMIPC_HAPID, HMIPC_NAME, HMIPC_PIN
|
||||||
_LOGGER,
|
|
||||||
DOMAIN as HMIPC_DOMAIN,
|
|
||||||
HMIPC_AUTHTOKEN,
|
|
||||||
HMIPC_HAPID,
|
|
||||||
HMIPC_NAME,
|
|
||||||
HMIPC_PIN,
|
|
||||||
)
|
|
||||||
from .hap import HomematicipAuth
|
from .hap import HomematicipAuth
|
||||||
|
|
||||||
|
|
||||||
@config_entries.HANDLERS.register(HMIPC_DOMAIN)
|
class HomematicipCloudFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
class HomematicipCloudFlowHandler(config_entries.ConfigFlow):
|
|
||||||
"""Config flow for the HomematicIP Cloud component."""
|
"""Config flow for the HomematicIP Cloud component."""
|
||||||
|
|
||||||
VERSION = 1
|
VERSION = 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user