Clean up deprecated connection class remainders (#75421)
This commit is contained in:
parent
d05160a402
commit
e65018fb85
2 changed files with 1 additions and 27 deletions
|
@ -10,7 +10,7 @@ from homeassistant.components import onboarding
|
|||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.data_entry_flow import FlowResult
|
||||
|
||||
from .typing import UNDEFINED, DiscoveryInfoType, UndefinedType
|
||||
from .typing import DiscoveryInfoType
|
||||
|
||||
if TYPE_CHECKING:
|
||||
import asyncio
|
||||
|
@ -173,23 +173,8 @@ def register_discovery_flow(
|
|||
domain: str,
|
||||
title: str,
|
||||
discovery_function: DiscoveryFunctionType[Awaitable[bool] | bool],
|
||||
connection_class: str | UndefinedType = UNDEFINED,
|
||||
) -> None:
|
||||
"""Register flow for discovered integrations that not require auth."""
|
||||
if connection_class is not UNDEFINED:
|
||||
_LOGGER.warning(
|
||||
(
|
||||
"The %s (%s) integration is setting a connection_class"
|
||||
" when calling the 'register_discovery_flow()' method in its"
|
||||
" config flow. The connection class has been deprecated and will"
|
||||
" be removed in a future release of Home Assistant."
|
||||
" If '%s' is a custom integration, please contact the author"
|
||||
" of that integration about this warning.",
|
||||
),
|
||||
title,
|
||||
domain,
|
||||
domain,
|
||||
)
|
||||
|
||||
class DiscoveryFlow(DiscoveryFlowHandler[Union[Awaitable[bool], bool]]):
|
||||
"""Discovery flow handler."""
|
||||
|
|
|
@ -418,14 +418,3 @@ async def test_webhook_create_cloudhook_aborts_not_connected(hass, webhook_flow_
|
|||
|
||||
assert result["type"] == data_entry_flow.FlowResultType.ABORT
|
||||
assert result["reason"] == "cloud_not_connected"
|
||||
|
||||
|
||||
async def test_warning_deprecated_connection_class(hass, caplog):
|
||||
"""Test that we log a warning when the connection_class is used."""
|
||||
discovery_function = Mock()
|
||||
with patch.dict(config_entries.HANDLERS):
|
||||
config_entry_flow.register_discovery_flow(
|
||||
"test", "Test", discovery_function, connection_class="local_polling"
|
||||
)
|
||||
|
||||
assert "integration is setting a connection_class" in caplog.text
|
||||
|
|
Loading…
Add table
Reference in a new issue