diff --git a/homeassistant/components/glances/config_flow.py b/homeassistant/components/glances/config_flow.py index 04e133248a6..58b81bc088e 100644 --- a/homeassistant/components/glances/config_flow.py +++ b/homeassistant/components/glances/config_flow.py @@ -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" diff --git a/tests/components/glances/test_config_flow.py b/tests/components/glances/test_config_flow.py index 187e319fe08..d4d25d8b86f 100644 --- a/tests/components/glances/test_config_flow.py +++ b/tests/components/glances/test_config_flow.py @@ -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