Finalize clean up connection classes (#49895)

This commit is contained in:
Franck Nijhof 2021-05-04 20:08:51 +02:00 committed by GitHub
parent ee5f955fd8
commit 96f69fb9fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 12 deletions

View File

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

View File

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

View File

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

View File

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