Finalize clean up connection classes (#49895)
This commit is contained in:
parent
ee5f955fd8
commit
96f69fb9fb
4 changed files with 7 additions and 12 deletions
|
@ -92,6 +92,13 @@ RECONFIGURE_NOTIFICATION_ID = "config_entry_reconfigure"
|
||||||
|
|
||||||
EVENT_FLOW_DISCOVERED = "config_entry_discovered"
|
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_PUSH = "cloud_push"
|
||||||
CONN_CLASS_CLOUD_POLL = "cloud_poll"
|
CONN_CLASS_CLOUD_POLL = "cloud_poll"
|
||||||
CONN_CLASS_LOCAL_PUSH = "local_push"
|
CONN_CLASS_LOCAL_PUSH = "local_push"
|
||||||
|
@ -99,10 +106,6 @@ CONN_CLASS_LOCAL_POLL = "local_poll"
|
||||||
CONN_CLASS_ASSUMED = "assumed"
|
CONN_CLASS_ASSUMED = "assumed"
|
||||||
CONN_CLASS_UNKNOWN = "unknown"
|
CONN_CLASS_UNKNOWN = "unknown"
|
||||||
|
|
||||||
DISABLED_USER = "user"
|
|
||||||
|
|
||||||
RELOAD_AFTER_UPDATE_DELAY = 30
|
|
||||||
|
|
||||||
|
|
||||||
class ConfigError(HomeAssistantError):
|
class ConfigError(HomeAssistantError):
|
||||||
"""Error while configuring an account."""
|
"""Error while configuring an account."""
|
||||||
|
@ -1068,8 +1071,6 @@ class ConfigFlow(data_entry_flow.FlowHandler):
|
||||||
if domain is not None:
|
if domain is not None:
|
||||||
HANDLERS.register(domain)(cls)
|
HANDLERS.register(domain)(cls)
|
||||||
|
|
||||||
CONNECTION_CLASS = CONN_CLASS_UNKNOWN
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def unique_id(self) -> str | None:
|
def unique_id(self) -> str | None:
|
||||||
"""Return unique ID if available."""
|
"""Return unique ID if available."""
|
||||||
|
|
|
@ -212,7 +212,6 @@ class AbstractOAuth2FlowHandler(config_entries.ConfigFlow, metaclass=ABCMeta):
|
||||||
DOMAIN = ""
|
DOMAIN = ""
|
||||||
|
|
||||||
VERSION = 1
|
VERSION = 1
|
||||||
CONNECTION_CLASS = config_entries.CONN_CLASS_UNKNOWN
|
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
"""Instantiate config flow."""
|
"""Instantiate config flow."""
|
||||||
|
|
|
@ -65,8 +65,6 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
"""Handle a config flow for NEW_NAME."""
|
"""Handle a config flow for NEW_NAME."""
|
||||||
|
|
||||||
VERSION = 1
|
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(
|
async def async_step_user(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
"""Config flow for NEW_NAME."""
|
"""Config flow for NEW_NAME."""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant import config_entries
|
|
||||||
from homeassistant.helpers import config_entry_oauth2_flow
|
from homeassistant.helpers import config_entry_oauth2_flow
|
||||||
|
|
||||||
from .const import DOMAIN
|
from .const import DOMAIN
|
||||||
|
@ -13,8 +12,6 @@ class OAuth2FlowHandler(
|
||||||
"""Config flow to handle NEW_NAME OAuth2 authentication."""
|
"""Config flow to handle NEW_NAME OAuth2 authentication."""
|
||||||
|
|
||||||
DOMAIN = DOMAIN
|
DOMAIN = DOMAIN
|
||||||
# TODO Pick one from config_entries.CONN_CLASS_*
|
|
||||||
CONNECTION_CLASS = config_entries.CONN_CLASS_UNKNOWN
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def logger(self) -> logging.Logger:
|
def logger(self) -> logging.Logger:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue