Clean up config entry handlers decorator from config flows (#49932)

This commit is contained in:
Franck Nijhof 2021-04-30 23:28:25 +02:00 committed by GitHub
parent 59f32f7c9c
commit e1a3ef3d69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 26 additions and 49 deletions

View file

@ -38,8 +38,7 @@ def register_flow_implementation(hass, client_id, client_secret):
} }
@config_entries.HANDLERS.register(DOMAIN) class AmbiclimateFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
class AmbiclimateFlowHandler(config_entries.ConfigFlow):
"""Handle a config flow.""" """Handle a config flow."""
VERSION = 1 VERSION = 1

View file

@ -18,8 +18,7 @@ def get_entry_client(hass, entry):
return hass.data[DOMAIN_DATA_ENTRIES][entry.entry_id] return hass.data[DOMAIN_DATA_ENTRIES][entry.entry_id]
@config_entries.HANDLERS.register(DOMAIN) class ArcamFmjFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
class ArcamFmjFlowHandler(config_entries.ConfigFlow):
"""Handle config flow.""" """Handle config flow."""
VERSION = 1 VERSION = 1

View file

@ -5,8 +5,7 @@ from homeassistant import config_entries
from .const import DOMAIN from .const import DOMAIN
@config_entries.HANDLERS.register(DOMAIN) class AWSFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
class AWSFlowHandler(config_entries.ConfigFlow):
"""Handle a config flow.""" """Handle a config flow."""
VERSION = 1 VERSION = 1

View file

@ -17,8 +17,7 @@ from .const import CONF_UUID, DOMAIN, KEY_MAC, TIMEOUT
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
@config_entries.HANDLERS.register(DOMAIN) class FlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
class FlowHandler(config_entries.ConfigFlow):
"""Handle a config flow.""" """Handle a config flow."""
VERSION = 1 VERSION = 1

View file

@ -16,8 +16,7 @@ def configured_servers(hass):
} }
@config_entries.HANDLERS.register(DOMAIN) class EmulatedRokuFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
class EmulatedRokuFlowHandler(config_entries.ConfigFlow):
"""Handle an emulated_roku config flow.""" """Handle an emulated_roku config flow."""
VERSION = 1 VERSION = 1

View file

@ -28,8 +28,7 @@ from .const import (
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
@config_entries.HANDLERS.register(DOMAIN) class FritzBoxToolsFlowHandler(ConfigFlow, domain=DOMAIN):
class FritzBoxToolsFlowHandler(ConfigFlow):
"""Handle a FRITZ!Box Tools config flow.""" """Handle a FRITZ!Box Tools config flow."""
VERSION = 1 VERSION = 1

View file

@ -16,8 +16,7 @@ def format_title(host: str) -> str:
return f"Controller ({host})" return f"Controller ({host})"
@config_entries.HANDLERS.register(DOMAIN) class HeosFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
class HeosFlowHandler(config_entries.ConfigFlow):
"""Define a flow for HEOS.""" """Define a flow for HEOS."""
VERSION = 1 VERSION = 1

View file

@ -83,8 +83,7 @@ def ensure_pin_format(pin):
return "-".join(match.groups()) return "-".join(match.groups())
@config_entries.HANDLERS.register(DOMAIN) class HomekitControllerFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
class HomekitControllerFlowHandler(config_entries.ConfigFlow):
"""Handle a HomeKit config flow.""" """Handle a HomeKit config flow."""
VERSION = 1 VERSION = 1

View file

@ -11,8 +11,7 @@ from homeassistant.helpers.typing import ConfigType
from .const import DOMAIN from .const import DOMAIN
@config_entries.HANDLERS.register(DOMAIN) class AqualinkFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
class AqualinkFlowHandler(config_entries.ConfigFlow):
"""Aqualink config flow.""" """Aqualink config flow."""
VERSION = 1 VERSION = 1

View file

@ -9,8 +9,7 @@ from .const import DOMAIN, HOME_LOCATION_NAME
from .weather import FORECAST_MODE from .weather import FORECAST_MODE
@config_entries.HANDLERS.register(DOMAIN) class IpmaFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
class IpmaFlowHandler(config_entries.ConfigFlow):
"""Config flow for IPMA component.""" """Config flow for IPMA component."""
VERSION = 1 VERSION = 1

View file

@ -57,8 +57,7 @@ async def validate_connection(host_name, data):
return data return data
@config_entries.HANDLERS.register(DOMAIN) class LcnFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
class LcnFlowHandler(config_entries.ConfigFlow):
"""Handle a LCN config flow.""" """Handle a LCN config flow."""
VERSION = 1 VERSION = 1

View file

@ -16,8 +16,7 @@ _LOGGER = logging.getLogger(__name__)
DOCS_URL = "https://www.home-assistant.io/integrations/life360" DOCS_URL = "https://www.home-assistant.io/integrations/life360"
@config_entries.HANDLERS.register(DOMAIN) class Life360ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
class Life360ConfigFlow(config_entries.ConfigFlow):
"""Life360 integration config flow.""" """Life360 integration config flow."""
VERSION = 1 VERSION = 1

View file

@ -54,8 +54,7 @@ def register_flow_implementation(
} }
@config_entries.HANDLERS.register(DOMAIN) class LogiCircleFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
class LogiCircleFlowHandler(config_entries.ConfigFlow):
"""Config flow for Logi Circle component.""" """Config flow for Logi Circle component."""
VERSION = 1 VERSION = 1

View file

@ -38,8 +38,7 @@ def duplicate_stations(hass):
return {x for x in stations if stations.count(x) > 1} return {x for x in stations if stations.count(x) > 1}
@config_entries.HANDLERS.register(DOMAIN) class LuftDatenFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
class LuftDatenFlowHandler(config_entries.ConfigFlow):
"""Handle a Luftdaten config flow.""" """Handle a Luftdaten config flow."""
VERSION = 1 VERSION = 1

View file

@ -9,8 +9,7 @@ from homeassistant.helpers import entity_registry as er
from .const import ATTR_APP_ID, ATTR_DEVICE_NAME, CONF_USER_ID, DOMAIN from .const import ATTR_APP_ID, ATTR_DEVICE_NAME, CONF_USER_ID, DOMAIN
@config_entries.HANDLERS.register(DOMAIN) class MobileAppFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
class MobileAppFlowHandler(config_entries.ConfigFlow):
"""Handle a Mobile App config flow.""" """Handle a Mobile App config flow."""
VERSION = 1 VERSION = 1

View file

@ -32,8 +32,7 @@ from .const import (
from .util import MQTT_WILL_BIRTH_SCHEMA from .util import MQTT_WILL_BIRTH_SCHEMA
@config_entries.HANDLERS.register(DOMAIN) class FlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
class FlowHandler(config_entries.ConfigFlow):
"""Handle a config flow.""" """Handle a config flow."""
VERSION = 1 VERSION = 1

View file

@ -65,7 +65,6 @@ class UnexpectedStateError(HomeAssistantError):
"""Raised when the config flow is invoked in a 'should not happen' case.""" """Raised when the config flow is invoked in a 'should not happen' case."""
@config_entries.HANDLERS.register(DOMAIN)
class NestFlowHandler( class NestFlowHandler(
config_entry_oauth2_flow.AbstractOAuth2FlowHandler, domain=DOMAIN config_entry_oauth2_flow.AbstractOAuth2FlowHandler, domain=DOMAIN
): ):

View file

@ -40,8 +40,7 @@ def register_flow_implementation(hass, domain, client_id, client_secret):
} }
@config_entries.HANDLERS.register(DOMAIN) class PointFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
class PointFlowHandler(config_entries.ConfigFlow):
"""Handle a config flow.""" """Handle a config flow."""
VERSION = 1 VERSION = 1

View file

@ -31,8 +31,7 @@ PORT_MSG = {UDP_PORT: "port_987_bind_error", TCP_PORT: "port_997_bind_error"}
PIN_LENGTH = 8 PIN_LENGTH = 8
@config_entries.HANDLERS.register(DOMAIN) class PlayStation4FlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
class PlayStation4FlowHandler(config_entries.ConfigFlow):
"""Handle a PlayStation 4 config flow.""" """Handle a PlayStation 4 config flow."""
VERSION = CONFIG_ENTRY_VERSION VERSION = CONFIG_ENTRY_VERSION

View file

@ -21,8 +21,7 @@ def smhi_locations(hass: HomeAssistant):
} }
@config_entries.HANDLERS.register(DOMAIN) class SmhiFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
class SmhiFlowHandler(config_entries.ConfigFlow):
"""Config flow for SMHI component.""" """Config flow for SMHI component."""
VERSION = 1 VERSION = 1

View file

@ -7,8 +7,9 @@ from homeassistant.helpers import config_entry_oauth2_flow
from .const import DOMAIN from .const import DOMAIN
@config_entries.HANDLERS.register(DOMAIN) class SomfyFlowHandler(
class SomfyFlowHandler(config_entry_oauth2_flow.AbstractOAuth2FlowHandler): config_entry_oauth2_flow.AbstractOAuth2FlowHandler, domain=DOMAIN
):
"""Config flow to handle Somfy OAuth2 authentication.""" """Config flow to handle Somfy OAuth2 authentication."""
DOMAIN = DOMAIN DOMAIN = DOMAIN

View file

@ -29,8 +29,7 @@ KEY_TOKEN_SECRET = "token_secret"
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
@config_entries.HANDLERS.register(DOMAIN) class FlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
class FlowHandler(config_entries.ConfigFlow):
"""Handle a config flow.""" """Handle a config flow."""
VERSION = 1 VERSION = 1

View file

@ -29,8 +29,7 @@ class AuthError(Exception):
self.code = code self.code = code
@config_entries.HANDLERS.register(DOMAIN) class FlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
class FlowHandler(config_entries.ConfigFlow):
"""Handle a config flow.""" """Handle a config flow."""
VERSION = 1 VERSION = 1

View file

@ -17,8 +17,7 @@ def configured_instances(hass):
return hass.config_entries.async_entries(DOMAIN) return hass.config_entries.async_entries(DOMAIN)
@config_entries.HANDLERS.register(DOMAIN) class VeSyncFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
class VeSyncFlowHandler(config_entries.ConfigFlow):
"""Handle a config flow.""" """Handle a config flow."""
VERSION = 1 VERSION = 1

View file

@ -14,8 +14,7 @@ from .const import (
) )
@config_entries.HANDLERS.register(DOMAIN) class ZwaveFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
class ZwaveFlowHandler(config_entries.ConfigFlow):
"""Handle a Z-Wave config flow.""" """Handle a Z-Wave config flow."""
VERSION = 1 VERSION = 1