mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 04:37:06 +00:00
Allow glances entries with same IP but different ports (#99536)
This commit is contained in:
parent
d19f617c25
commit
ca44242095
@ -61,11 +61,14 @@ class GlancesFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||
"""Handle the initial step."""
|
||||
errors = {}
|
||||
if user_input is not None:
|
||||
self._async_abort_entries_match({CONF_HOST: user_input[CONF_HOST]})
|
||||
self._async_abort_entries_match(
|
||||
{CONF_HOST: user_input[CONF_HOST], CONF_PORT: user_input[CONF_PORT]}
|
||||
)
|
||||
try:
|
||||
await validate_input(self.hass, user_input)
|
||||
return self.async_create_entry(
|
||||
title=user_input[CONF_HOST], data=user_input
|
||||
title=f"{user_input[CONF_HOST]}:{user_input[CONF_PORT]}",
|
||||
data=user_input,
|
||||
)
|
||||
except CannotConnect:
|
||||
errors["base"] = "cannot_connect"
|
||||
|
@ -35,7 +35,7 @@ async def test_form(hass: HomeAssistant) -> None:
|
||||
)
|
||||
|
||||
assert result["type"] == FlowResultType.CREATE_ENTRY
|
||||
assert result["title"] == "0.0.0.0"
|
||||
assert result["title"] == "0.0.0.0:61208"
|
||||
assert result["data"] == MOCK_USER_INPUT
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user