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
3 changed files with 0 additions and 13 deletions
|
@ -18,7 +18,6 @@ from homeassistant.data_entry_flow import FlowResult
|
||||||
|
|
||||||
from .const import CONF_GATEWAY_ID, CONF_IDENTITY, CONF_KEY, DOMAIN
|
from .const import CONF_GATEWAY_ID, CONF_IDENTITY, CONF_KEY, DOMAIN
|
||||||
|
|
||||||
CONF_IMPORT_GROUPS = "import_groups"
|
|
||||||
KEY_SECURITY_CODE = "security_code"
|
KEY_SECURITY_CODE = "security_code"
|
||||||
|
|
||||||
|
|
||||||
|
@ -39,7 +38,6 @@ class FlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
"""Initialize flow."""
|
"""Initialize flow."""
|
||||||
self._host: str | None = None
|
self._host: str | None = None
|
||||||
self._import_groups = False
|
|
||||||
|
|
||||||
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
|
||||||
|
@ -60,11 +58,6 @@ class FlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
self.hass, host, user_input[KEY_SECURITY_CODE]
|
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)
|
return await self._entry_from_data(auth)
|
||||||
|
|
||||||
except AuthError as err:
|
except AuthError as err:
|
||||||
|
@ -122,7 +115,6 @@ class FlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
# Happens if user has host directly in configuration.yaml
|
# Happens if user has host directly in configuration.yaml
|
||||||
if "key" not in user_input:
|
if "key" not in user_input:
|
||||||
self._host = user_input["host"]
|
self._host = user_input["host"]
|
||||||
self._import_groups = user_input[CONF_IMPORT_GROUPS]
|
|
||||||
return await self.async_step_auth()
|
return await self.async_step_auth()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -134,8 +126,6 @@ class FlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
user_input["key"],
|
user_input["key"],
|
||||||
)
|
)
|
||||||
|
|
||||||
data[CONF_IMPORT_GROUPS] = user_input[CONF_IMPORT_GROUPS]
|
|
||||||
|
|
||||||
return await self._entry_from_data(data)
|
return await self._entry_from_data(data)
|
||||||
except AuthError:
|
except AuthError:
|
||||||
# If we fail to connect, just pass it on to discovery
|
# 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 == {
|
assert result["result"].data == {
|
||||||
"host": "123.123.123.123",
|
"host": "123.123.123.123",
|
||||||
"gateway_id": "bla",
|
"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 == {
|
assert result["result"].data == {
|
||||||
"host": "123.123.123.123",
|
"host": "123.123.123.123",
|
||||||
"gateway_id": "bla",
|
"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",
|
"host": "mock-host",
|
||||||
"identity": "mock-identity",
|
"identity": "mock-identity",
|
||||||
"key": "mock-key",
|
"key": "mock-key",
|
||||||
"import_groups": False,
|
|
||||||
"gateway_id": GATEWAY_ID,
|
"gateway_id": GATEWAY_ID,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue