Clean last usages of old config flow handlers decorator (#64329)

This commit is contained in:
Franck Nijhof 2022-01-18 07:02:12 +01:00 committed by GitHub
parent 8bcf495caf
commit a0bbe46c4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 23 deletions

View File

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

View File

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

View File

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