mirror of
https://github.com/home-assistant/core.git
synced 2025-04-22 16:27:56 +00:00
Finalize deprecation of groups in Tradfri integration (#69460)
* Finalise cleanup of groups * Fix tests * Remove * Revert change
This commit is contained in:
parent
c583df74e4
commit
74021d62da
@ -18,7 +18,6 @@ from homeassistant.data_entry_flow import FlowResult
|
||||
|
||||
from .const import CONF_GATEWAY_ID, CONF_IDENTITY, CONF_KEY, DOMAIN
|
||||
|
||||
CONF_IMPORT_GROUPS = "import_groups"
|
||||
KEY_SECURITY_CODE = "security_code"
|
||||
|
||||
|
||||
@ -39,7 +38,6 @@ class FlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||
def __init__(self) -> None:
|
||||
"""Initialize flow."""
|
||||
self._host: str | None = None
|
||||
self._import_groups = False
|
||||
|
||||
async def async_step_user(
|
||||
self, user_input: dict[str, Any] | None = None
|
||||
@ -60,11 +58,6 @@ class FlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||
self.hass, host, user_input[KEY_SECURITY_CODE]
|
||||
)
|
||||
|
||||
# We don't ask for import group anymore as group state
|
||||
# is not reliable, don't want to show that to the user.
|
||||
# But we still allow specifying import group via config yaml.
|
||||
auth[CONF_IMPORT_GROUPS] = self._import_groups
|
||||
|
||||
return await self._entry_from_data(auth)
|
||||
|
||||
except AuthError as err:
|
||||
@ -122,7 +115,6 @@ class FlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||
# Happens if user has host directly in configuration.yaml
|
||||
if "key" not in user_input:
|
||||
self._host = user_input["host"]
|
||||
self._import_groups = user_input[CONF_IMPORT_GROUPS]
|
||||
return await self.async_step_auth()
|
||||
|
||||
try:
|
||||
@ -134,8 +126,6 @@ class FlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||
user_input["key"],
|
||||
)
|
||||
|
||||
data[CONF_IMPORT_GROUPS] = user_input[CONF_IMPORT_GROUPS]
|
||||
|
||||
return await self._entry_from_data(data)
|
||||
except AuthError:
|
||||
# If we fail to connect, just pass it on to discovery
|
||||
|
@ -57,7 +57,6 @@ async def test_user_connection_successful(hass, mock_auth, mock_entry_setup):
|
||||
assert result["result"].data == {
|
||||
"host": "123.123.123.123",
|
||||
"gateway_id": "bla",
|
||||
"import_groups": False,
|
||||
}
|
||||
|
||||
|
||||
@ -126,7 +125,6 @@ async def test_discovery_connection(hass, mock_auth, mock_entry_setup):
|
||||
assert result["result"].data == {
|
||||
"host": "123.123.123.123",
|
||||
"gateway_id": "bla",
|
||||
"import_groups": False,
|
||||
}
|
||||
|
||||
|
||||
|
@ -150,7 +150,6 @@ async def test_unique_id_migration(hass, mock_gateway, mock_api_factory):
|
||||
"host": "mock-host",
|
||||
"identity": "mock-identity",
|
||||
"key": "mock-key",
|
||||
"import_groups": False,
|
||||
"gateway_id": GATEWAY_ID,
|
||||
},
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user