diff --git a/homeassistant/config_entries.py b/homeassistant/config_entries.py index 76e523a6d89..7275d3101a9 100644 --- a/homeassistant/config_entries.py +++ b/homeassistant/config_entries.py @@ -92,6 +92,13 @@ RECONFIGURE_NOTIFICATION_ID = "config_entry_reconfigure" EVENT_FLOW_DISCOVERED = "config_entry_discovered" +DISABLED_USER = "user" + +RELOAD_AFTER_UPDATE_DELAY = 30 + +# Deprecated: Connection classes +# These aren't used anymore since 2021.6.0 +# Mainly here not to break custom integrations. CONN_CLASS_CLOUD_PUSH = "cloud_push" CONN_CLASS_CLOUD_POLL = "cloud_poll" CONN_CLASS_LOCAL_PUSH = "local_push" @@ -99,10 +106,6 @@ CONN_CLASS_LOCAL_POLL = "local_poll" CONN_CLASS_ASSUMED = "assumed" CONN_CLASS_UNKNOWN = "unknown" -DISABLED_USER = "user" - -RELOAD_AFTER_UPDATE_DELAY = 30 - class ConfigError(HomeAssistantError): """Error while configuring an account.""" @@ -1068,8 +1071,6 @@ class ConfigFlow(data_entry_flow.FlowHandler): if domain is not None: HANDLERS.register(domain)(cls) - CONNECTION_CLASS = CONN_CLASS_UNKNOWN - @property def unique_id(self) -> str | None: """Return unique ID if available.""" diff --git a/homeassistant/helpers/config_entry_oauth2_flow.py b/homeassistant/helpers/config_entry_oauth2_flow.py index ede345ce7de..be9afe385ca 100644 --- a/homeassistant/helpers/config_entry_oauth2_flow.py +++ b/homeassistant/helpers/config_entry_oauth2_flow.py @@ -212,7 +212,6 @@ class AbstractOAuth2FlowHandler(config_entries.ConfigFlow, metaclass=ABCMeta): DOMAIN = "" VERSION = 1 - CONNECTION_CLASS = config_entries.CONN_CLASS_UNKNOWN def __init__(self) -> None: """Instantiate config flow.""" diff --git a/script/scaffold/templates/config_flow/integration/config_flow.py b/script/scaffold/templates/config_flow/integration/config_flow.py index 886f3223655..f88390599e7 100644 --- a/script/scaffold/templates/config_flow/integration/config_flow.py +++ b/script/scaffold/templates/config_flow/integration/config_flow.py @@ -65,8 +65,6 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): """Handle a config flow for NEW_NAME.""" VERSION = 1 - # TODO pick one of the available connection classes in homeassistant/config_entries.py - CONNECTION_CLASS = config_entries.CONN_CLASS_UNKNOWN async def async_step_user( self, user_input: dict[str, Any] | None = None diff --git a/script/scaffold/templates/config_flow_oauth2/integration/config_flow.py b/script/scaffold/templates/config_flow_oauth2/integration/config_flow.py index 8670c8a7b43..a035a65dbb3 100644 --- a/script/scaffold/templates/config_flow_oauth2/integration/config_flow.py +++ b/script/scaffold/templates/config_flow_oauth2/integration/config_flow.py @@ -1,7 +1,6 @@ """Config flow for NEW_NAME.""" import logging -from homeassistant import config_entries from homeassistant.helpers import config_entry_oauth2_flow from .const import DOMAIN @@ -13,8 +12,6 @@ class OAuth2FlowHandler( """Config flow to handle NEW_NAME OAuth2 authentication.""" DOMAIN = DOMAIN - # TODO Pick one from config_entries.CONN_CLASS_* - CONNECTION_CLASS = config_entries.CONN_CLASS_UNKNOWN @property def logger(self) -> logging.Logger: