Mark mqtt as integration with single config entry (#128202)

This commit is contained in:
Jan Bouwhuis 2024-10-12 19:55:39 +02:00 committed by GitHub
parent edb30af441
commit 3112682923
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 5 deletions

View File

@ -343,9 +343,6 @@ class FlowHandler(ConfigFlow, domain=DOMAIN):
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
"""Handle a flow initialized by the user."""
if self._async_current_entries():
return self.async_abort(reason="single_instance_allowed")
if is_hassio(self.hass):
# Offer to set up broker add-on if supervisor is available
self._addon_manager = get_addon_manager(self.hass)

View File

@ -7,5 +7,6 @@
"documentation": "https://www.home-assistant.io/integrations/mqtt",
"iot_class": "local_push",
"quality_scale": "platinum",
"requirements": ["paho-mqtt==1.6.1"]
"requirements": ["paho-mqtt==1.6.1"],
"single_config_entry": true
}

View File

@ -420,7 +420,7 @@ async def test_hassio_already_configured(hass: HomeAssistant) -> None:
"mqtt", context={"source": config_entries.SOURCE_HASSIO}
)
assert result["type"] is FlowResultType.ABORT
assert result["reason"] == "already_configured"
assert result["reason"] == "single_instance_allowed"
async def test_hassio_ignored(hass: HomeAssistant) -> None: